Skip to content
Other

openmvs-flexglue-onnx

image matching and camera pose estimation in ONNX

2 min readupdated

A collection of FlexGlue neural network graphs in ONNX format (an open standard for fast model inference), prepared by developer cDcSeacave specifically for the OpenMVS 3D reconstruction system. The model handles two tasks at once: it selects overlapping photo pairs and builds a dense pixel-correspondence map in a single pass, while also estimating relative camera poses without requiring intrinsic parameters (intrinsics-free). Under the hood is a DINOv3 ConvNeXt-B backbone (87.6M parameters) with 9 transformer layers and an additional H1 head for pose calculation. The package mirrors the RoMa v2 bundle format, allowing it to serve as a drop-in replacement in photogrammetry and 3D scanning pipelines.

Key features

  • Two separate graphs: descriptor (358 MB, fp32) extracts 64×64 features and a global vector to retrieve similar frame pairs, while match (98 MB, fp16) performs dense correspondence matching.
  • Calibration-free pose estimation: the built-in H1 head (0.46M parameters) outputs the rotation matrix and translation direction between cameras in ~0.5 ms on an A100 GPU.
  • Built-in filtering: the matching graph directly estimates scene covisibility and discards unreliable points using a confidence threshold and forward-backward cycle consistency.
  • ONNX Runtime compatibility: leverages optimized MultiHeadAttention and Gelu operators to run natively inside OpenMVS C++ code without any PyTorch dependency.

What you can do

  • Speed up 3D reconstruction in OpenMVS: plug the model into the CreateStructure utility for image pair retrieval and dense matching when generating point clouds from photos.
  • Process uncalibrated captures: recover relative frame geometry from handheld cameras, drones, or web-scraped imagery where exact lens parameters are unknown.
  • Integrate into custom C++/Python pipelines: run the exported ONNX files directly via ONNX Runtime 1.23+ with minimal numerical drift compared to the original PyTorch implementation.

Example

cmake --build . --target flexglue-model
CreateStructure images/ --roma2 true --dense-matcher flexglue --match-mode 4
CreateStructure images/ --roma2 true --dense-matcher flexglue --match-mode 4 --roma2-match true
Read moreDetails
Accuracy vs. PyTorch (CUDA, fp16): median warp error of 3.2e-5 (99.9% valid cell agreement), pose error of 0.048° in rotation and 0.136° in translation direction.
Requirements: OpenMVS built with the -DOpenMVS_USE_ONNXRUNTIME=ON flag; input images are resized to 512×512 (batch size 1).
License: the matching graph and H1 head are under the MIT license, while the descriptor graph includes the DINOv3 backbone (Meta), subject to the strict DINOv3 license prohibiting military use.
Discuss Telegram 0

Will it run?

Runs in FP32

Fits without quantisation.

  • FP32weights 0.3 GB · ready files0.9 GB
  • BF16weights 0.2 GB0.7 GB
  • FP8 / INT8recommendedweights 0.1 GB0.6 GB
  • 4-bitweights 0.0 GB0.6 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · FP32 — from RTX 2060

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # cDcSeacave/openmvs-flexglue-onnx
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download cDcSeacave/openmvs-flexglue-onnx --local-dir ~/models/openmvs-flexglue-onnx
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to openmvs-flexglue-onnx
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of openmvs-flexglue-onnx (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

cDcSeacave/openmvs-flexglue-onnx
Author
cDcSeacave
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments