Skip to main content

FlashIM

Fast, quantized, multi-platform inference for image matching.
Dense and sparse matchers as native PyTorch ports, with FP8 / INT8 quantization and custom kernels.

Apache-2.0 · Models · Inference benchmark · Configuration · Platforms · Architecture

FlashIM runs image-matching models faster than their reference implementations, without giving up measured accuracy. Every model is a native PyTorch port checked against the upstream code. The speedups come from quantization (MXFP8, INT8), fused kernels (Triton, TileLang, CUDA C++) and torch.compile.

  • Custom kernels are first-class. Every op has a torch reference (the correctness oracle and universal fallback) and optional optimized implementations that are picked by platform and shape.
  • Quantization with evidence. FP8 / INT8 presets are accepted by task-level pose AUC (MegaDepth-1500, ScanNet-1500, HardMatch), not by tensor allclose.
  • Multi-platform by design. Device detection separates vendor, dispatch key and ISA features. NVIDIA from Ampere to Blackwell today; ROCm, NPU and XPU are planned.
  • One interface. Every model loads with flashim.load(name, preset), where the preset is fp32, bf16, int8 or fp8, and matches with model.match(a, b), which returns the same Matches for dense, detector-free and sparse models.

Quick start

FlashIM is not on PyPI yet; install from source (Linux, Python 3.10 or newer, an NVIDIA GPU is recommended):

pip install "flashim[cv] @ git+https://github.com/lnexenl/FlashIM"   # or, in a checkout: uv sync --extra eval

The cv extra adds OpenCV (SIFT, ORB), eval the accuracy benchmarks' dependencies. Jetson (JetPack 6) installs from requirements-jetson.txt (NVIDIA's torch build).

import flashim

flashim.available_models()                                   # every registered name

model = flashim.load("romav2", "fp8", engine="compile-full", overrides={"arch.setting": "mega1500"})
m = model.match("a.jpg", "b.jpg", max_matches=5000)          # Matches: 5000 balanced samples of the dense warp
m.keypoints_A, m.keypoints_B, m.confidence                   # [N, 2] pixels of each original image, [N]
m.dense.warp_AB                                              # the full dense prediction (DenseMatchResult)

pipeline = flashim.load("raco-aliked-lightglue", "bf16", engine="compile")
m = pipeline.match("a.jpg", "b.jpg", resize=1024, max_matches=1024)   # Matches: 1024 keypoints per image
m.indices_A, m.features_A                                    # match indices into each image's keypoints

loma = flashim.load("loma-g")                                # DaD + LoMa descriptors + matcher
m = loma.match("a.jpg", "b.jpg", max_matches=4096)           # 4096 keypoints per image (default 2048)

match(a, b, *, resize, max_matches, threshold) is the same for every model: resize is the long side of the working resolution, max_matches bounds the matches the model's own way (keypoints per image, the most confident matches, or samples of a dense warp) and threshold is the model's match threshold. A model without the preset asked for builds the nearest one it has (fp8 -> int8 -> bf16 -> fp32), and a pipeline's preset applies to each of its components. A usage example for every model is in docs/models.md. Image paths given to a model on CUDA are decoded on the GPU when they are JPEGs (nvJPEG); FLASHIM_IMAGE_DECODER=pil decodes with PIL.

Weights download on first use into the torch hub checkpoint folder ($TORCH_HOME/hub/checkpoints) and are checked against SHA-256 hashes pinned in flashim/models/<model>/weights.py; checkpoint or FLASHIM_<MODEL>_CHECKPOINT points to a local file. See docs/checkpoints.md.

Models

docs/models.md lists every model with its presets and default; the licenses are in THIRD_PARTY_NOTICES.md.

category models
Dense romav2, roma, roma-indoor, minima-roma, tiny-roma, ufm
Dense 3D mast3r, dust3r (FP16 compute under bf16 / int8 / fp8)
Detector-free loftr, minima-loftr, eloftr, xoftr
Sparse extractors rdd, aliked, raco, raco-aliked, superpoint, disk, alike, xfeat, dedode, dedode-g, dad, ripe, ripepp, ripepp-aachen, ripepp-scared, sift, orb
Sparse matchers and pipelines lightglue, <extractor>-lightglue, loma, superglue, superpoint-superglue, omniglue
Sparse-to-dense flexglue

Weight licenses. Code is Apache-2.0, but weights keep their publishers' licenses and some are not open: ufm, mast3r, dust3r (CC BY-NC-SA 4.0), superpoint (Magic Leap), superglue and superpoint-superglue (Magic Leap, academic / non-profit research only), and ripe, ripepp, ripepp-aachen, ripepp-scared, ripepp-lightglue (Fraunhofer academic-use license v2.0) are non-commercial; romav2 and flexglue contain DINOv3 weights under the DINOv3 License. Check THIRD_PARTY_NOTICES.md before commercial use.

Results

All numbers are from an NVIDIA GeForce RTX 5070 Ti (sm_120). Latencies of every model under one protocol and the MegaDepth-1500 / ScanNet-1500 accuracy gate (AUC@5 drop < 0.005 vs bf16) are in the inference benchmark.

RoMaV2 (dense; mega1500 800² + 1024², both directions, forward only, RTX 5070 Ti sm_120):

preset eager compile-full vs bf16 (compile-full)
bf16 348.5 ms 194.3 ms 1.00x
fp8 110.7 ms 106.5 ms 1.82x
int8 107.1 ms 93.4 ms 2.08x

Pose AUC@5 vs the unoptimized bf16 (3 seeds, MegaDepth-1500 / ScanNet-1500, engine="compile"): fp8 -0.0044 / -0.0027, int8 -0.0032 / +0.0010 (0 FAIL under the paired-bootstrap gate). On the 900 deliberately hard HardMatch pairs fp8 costs 0.0074 mAA@10px, the same as RoMaV2's own FP8 recipe.

Other families (eager / compile, same GPU, one image or one pair; sizes and every model in the benchmark):

stage bf16 int8 fp8
rdd extract (1200 px, 4096 keypoints) 31.8 / 25.3 ms 26.5 / 22.8 ms
loma-g pair (2 x extract + match, 1024 px) 185.2 / 175.9 ms 81.8 ms (eager) 95.4 ms (eager)
flexglue match_keypoints (512x512) 35.1 / 33.7 ms 22.3 / 22.2 ms 18.0 / 17.9 ms

The reference RDD implementation without its CUDA extension runs out of memory on 16 GB.

Configuring a run

The four presets are named partial configs; config files, dicts, dotted overrides and load's keyword arguments (device, engine, strict, calibration) layer on top.

model = flashim.load("romav2", "fp8", overrides=["engine.kind=compile-full"])
model = flashim.load("raco-aliked-lightglue", "int8", config="run.toml")
flashim.resolve("rdd-lightglue", "fp8").to_dict()      # the config a build would use, without building
model.run_config.digest(), model.build_report          # what was asked for / what was actually applied

Unknown keys, passes and engines are errors; a pass the platform cannot run is skipped with a warning (optimize.strict=true raises instead). See docs/configuration.md.

Platforms

sm_120 (RTX 5070 Ti) is the primary target. sm_90 (H20), sm_89 (L20) and sm_87 (Jetson AGX Orin) are tuned; sm_100 is compile-checked only; sm_80 / sm_86 are not tuned. A GPU without FP8 builds the nearest other preset instead and says so in a warning and in model.build_report.fallbacks. Which model was tested on which GPU is in docs/platforms.md.

Development

uv sync --extra eval                     # Python 3.12, torch 2.11 (cu130), triton 3.6
uv run pytest -m "not slow"              # unit / ops / quant
uv run pytest tests/parity               # bit-exactness vs the vendored upstream code (needs weights + GPU)
uv run python benchmarks/speed/forward.py --preset fp8 --engine compile
uv run python benchmarks/accuracy/run.py --dataset mega1500 --preset fp8 --seed 17

Agents and contributors: start with AGENTS.md (layering rules, how to add an op, backend, model or platform, and how changes are verified). The layout and op dispatch are described in docs/architecture.md.

License

FlashIM is released under the Apache License 2.0 (LICENSE), with two exceptions inside the package: code ported from RoMaV2 (the RoMaV2 model and several Triton kernels) is under RoMaV2's MIT license (licenses/RoMaV2-MIT.txt), and flashim/models/romav2/dinov3.py and dpt.py follow DINOv3 / DPT code by Meta under the DINOv3 License Agreement (licenses/DINOv3-License.md). The package's license expression is Apache-2.0 AND MIT AND LicenseRef-DINOv3. Model weights are downloaded from their publishers, never shipped, and keep their upstream licenses (see the warning under Models); the full list, including the licenses of vendored test code and assets, is in THIRD_PARTY_NOTICES.md.

     

Metadata

Release files for flashim 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flashim 0.1.1
File Size Uploaded Provenance Actions
flashim-0.1.1.tar.gz 1.3 MB With provenance Details for flashim-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flashim 0.1.1
File Interpreter ABI Platform Actions
flashim-0.1.1-py3-none-any.whl Python 3 none any Details for flashim-0.1.1-py3-none-any.whl

Total release size: 2.8 MB

Release files / flashim-0.1.1.tar.gz

Download URL flashim-0.1.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
fd5eca4810c2dd20a4841d7d9d4dcaa890759f5c8579c2f01673e491f9a270e6
BLAKE2b-256 checksum
How to use checksums
6505383e668f34b821fff9dfbcaa5f1e3511e94846c451513ed2434a67d2b8d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / flashim-0.1.1-py3-none-any.whl

Download URL flashim-0.1.1-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c03cc72ba2dc83cb807606dd1948d5f8279581c36dc0af48e4540c177fb9b024
BLAKE2b-256 checksum
How to use checksums
1cad20169b1785165851f3a91441223debaab0802e6b0aa5653e48d52695e9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for flashim 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flashim-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page