A very good local feature matcher.
Project description
LoMa: Local Feature Matching Revisited
Chalmers University of Technology; Linköping University; University of Amsterdam; Lund University
David Nordström*, Johan Edstedt*, Georg Bökman, Jonathan Astermark, Anders Heyden, Viktor Larsson, Mårten Wadenbäck, Michael Felsberg, Fredrik Kahl
Performance on a difficult matching pair compared to LightGlue.
Overview
LoMa is a fast and accurate family of local feature matchers. It works similar to LightGlue but significantly improves matching robustness and accuracy across benchmarks, even outperforming RoMa and RoMa v2 on the difficult WxBS benchmark. As LoMa leverages local keypoint descriptions, the models are perfect drop-in replacement in e.g. SfM and Visual Localization pipelines.
Updates
- [April 6, 2026] LoMa inference code released.
How to Use
import cv2
from loma import LoMa, LoMaB
# load pretrained model
model = LoMa(LoMaB()) # also available: LoMaB128, LoMaL, LoMaG
# Define image paths, e.g.
img_A_path, img_B_path = "assets/0015_A.jpg", "assets/0015_B.jpg"
# Extract matching keypoints in image coordinates
kptsA, kptsB = model.match(img_A_path, img_B_path)
# Find a fundamental matrix (or anything else of interest)
F, mask = cv2.findFundamentalMat(
kptsA, kptsB, ransacReprojThreshold=0.2, method=cv2.USAC_MAGSAC, confidence=0.999999, maxIters=10000
)
We provide additional code examples in demo.py, which might help in understanding. To run the demo, use the following API:
uv run demo.py matcher:loma-b
Setup/Install
In your python environment (tested on Linux python 3.12), run:
uv pip install -e .
or
uv sync
Benchmarks
We initially provide code for evaluating on MegaDepth, ScanNet, WxBS and RUBIK. If you do not already have MegaDepth1500 and ScanNet1500, you may run the following to download them:
source scripts/eval_prep.sh
To run a benchmark you need to install the optional dependencies by e.g. uv sync --extra eval. Thereafter, you can use the following call signature:
uv run eval.py matcher:loma-b --benchmark wxbs
Use uv run eval.py --help to explore the different options.
Expected Results
The results are similar to those reported in the paper. For example, running the evaluation for LoMa-B on WxBS gives us mAA_10px: 0.6876.
Sizes
We an array of models: LoMA-{B, B128, L, G}. For most usecases LoMa-B, which is the same size as LightGlue, works fine. LoMa-G is significantly heavier but gives the most accurate matches, even surpassing the RoMa-family on e.g. WxBS and IMC22.
Checklist
- Publish the inference code.
- Release a lightweight descriptor.
- Integrate with HLoc.
- Provide training code.
- Release HardMatch.
License
All our code except the matcher, which inherits its license from LightGlue, is MIT license. LightGlue has an Apache-2.0 license.
Acknowledgement
Thanks to Parskatt for writing most of the code. Our codebase structure is mainly based on RoMaV2 and our architectures build on LightGlue, DeDoDe, and DaD.
BibTeX
If you find our models useful, please consider citing our paper!
Preprint coming soon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lomatch-1.0.0.tar.gz.
File metadata
- Download URL: lomatch-1.0.0.tar.gz
- Upload date:
- Size: 36.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c464b850b985e2697227363978057663097017810ec4a21348893cff00d41908
|
|
| MD5 |
ccd2dc1f83b19dddcfd01580dc0ce25e
|
|
| BLAKE2b-256 |
79156b60434a87abaa25532962cbce2976ff5e27ce6ea14c65108373e3cd65a3
|
File details
Details for the file lomatch-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lomatch-1.0.0-py3-none-any.whl
- Upload date:
- Size: 49.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1278d7809d5439d6183cced459fedd12c20aa5313dbcb2cfded9c92e25db5c8
|
|
| MD5 |
45e1432be7fd3a5a2453fbea4bf94c14
|
|
| BLAKE2b-256 |
21c5a75d9e7ec9dc7bf1cce713c8486ea7d9a60716a599ea3bb5a9e440267e1c
|