LoMa (fastforks)

LoMa (NordstrΓΆm, Edstedt et al. 2026): local feature matching with a light transformer. DaD (a VGG11 detector trained by distillation, Edstedt et al. 2025) finds 2048 keypoints per image, the DeDoDe-G descriptor (VGG19 + a frozen DINOv2 ViT-L/14) describes them, and nine LightGlue-style transformer layers (rotary self-attention, cross-attention) refine the descriptions before a dual-softmax assignment. Returns both keypoint sets, the index pairs of the matches and their scores.

This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/davnords/loma at 415caedde23a.

Task: matching. Tier: experimental. Outputs: keypoints1, keypoints2, pairs, scores. Backends: portable.

Input: two RGB images of one scene. Output: for every pixel of the first image its position in the second (x, y in pixels) and a certainty that the pixel is visible in both. Sparse matchers (LightGlue) return the keypoints of both images and the index pairs of the matched ones instead. To reconstruct camera poses from an image folder with these matchers, see structure from motion.

Variants

Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.

variant weights (author link) SHA-256 weights licence commercial use
loma-b@1 loma_B.pt 3a38824391e2 MIT yes

Licence

Original-code strings, recorded as they are (research-use package; check them before any other use). Code: MIT. Licence files: LICENSE, LICENSE-DAD, LICENSE-DEDODE, LICENSE-DINOv2.

Training data: MegaDepth (Internet photo collections with SfM / MVS depth) (Matcher: MegaDepth (paper); DaD: MegaDepth-based distillation (DaD paper); DeDoDe-G descriptor: MegaDepth; DINOv2 (frozen): LVD-142M (Meta).).

Licence evidence: https://github.com/davnords/loma/blob/415caedde23a9ed479172ed174fe4ff7b4514d4b/LICENSE ; https://github.com/Parskatt/dad/blob/41b9e86a1a3ae52128485cc1094aa4952ef489ba/LICENSE ; https://github.com/Parskatt/DeDoDe/blob/6d156183f4dc84cd704ae779eebc8350995c5b06/README.md#license

Input size

any H x W >= 32, padded to a multiple of 32 Tested up to (portable, fp16, RTX 5060 Ti 16 GB): loma-b 3000x4000 (2.4 GiB peak allocated, 3.6 reserved)

Speed and memory

Matching, synthetic, 768x1024

model time (ms): original fp32 original portable kernels kernels speed-up: vs original vs portable peak memory (MiB, allocated / reserved): original portable kernels
loma-b – – 308 – – – – 1767 / 1878 –

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
loma-b – 2.53 – – 1.27 –

torch.compile and TensorRT

model input time: portable compile TensorRT fp16 kernels preparation: compile (cold first call) ONNX + engine build peak MiB (alloc / reserved): portable compile kernels TensorRT (engine + torch)
loma-b 768x1024 308 ms 285 ms planned for 0.2.1 – 104 s – 1767 / 1878 2870 / 3216 – –

Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).

Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.

Accuracy

Parity with the original code

Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.011 vs the original. GPU, portable bfloat16 and kernels float16 (the defaults): mean |diff| <= 0.002 and p99 <= 0.001 (absolute error of the output keypoints1).

Limitations

  • Sparse output: no dense warp. result.matches() gives the matched points for estimate_pose; pairs are the index pairs pycolmap / COLMAP databases take.
  • One image pair per call internally (batches run pair by pair); the match counts differ per pair.
  • No exportable module: the match counts are data-dependent (torch.compile runs with graph breaks; ONNX / TensorRT export fails).
  • Two resizes per image as upstream: the detector sees a long side of long_side (aspect kept), the descriptor a size x size square whatever the aspect ratio.
  • Upright only: the released weights are not trained for in-plane rotations.

Usage

from fastforks import matching

model = matching.load("loma-b")  # mode="auto": the preferred backend from recorded measurements
result = model("view1.jpg", "view2.jpg")
result.keypoints1  # [2, H1, W1] float32: x, y in view2 pixels
result.backend  # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')

Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: loma-b.

Kernels backend

No kernels backend: not implemented: data-dependent keypoint and match counts. Portable is 307.9 ms against 382.8 ms for the original fp16 (1.24x) and 409.1 ms fp32, peak allocated 1790 vs 1843 MB (reserved 2562 vs 3398), matches 1030 vs 1038-1039.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including fastforks/loma