Repository navigation
Conversation
Contributor
|
Looks awesome. Thanks! Will take a closer look in the next days. |
sarlinpe
force-pushed
the
sarlinpe/flexglue-device-features
branch
from
October 28, 2026 07:45
0b1137b to
a239675
Compare
sarlinpe
force-pushed
the
sarlinpe/flexglue-early-stop
branch
from
October 28, 2026 07:45
b252ba4 to
bc7c6f4
Compare
sarlinpe
force-pushed
the
sarlinpe/flexglue-early-stop
branch
from
October 28, 2026 23:58
bc7c6f4 to
32bbab5
Compare
Overrides the maximum number of features per image of the selected feature type (SIFT, ALIKED, LoMa), e.g. to evaluate learned features with more keypoints than the default.
sarlinpe
force-pushed
the
sarlinpe/flexglue-device-features
branch
from
October 29, 2026 05:43
a239675 to
362913f
Compare
sarlinpe
force-pushed
the
sarlinpe/flexglue-early-stop
branch
from
October 29, 2026 05:43
32bbab5 to
8256489
Compare
sarlinpe
force-pushed
the
sarlinpe/flexglue-device-features
branch
from
October 29, 2026 05:56
362913f to
d88c10d
Compare
sarlinpe
force-pushed
the
sarlinpe/flexglue-early-stop
branch
from
October 29, 2026 05:56
8256489 to
bbe1e82
Compare
An exception thrown while matching a pair (e.g., an unreadable image or unexpected features) used to escape FeatureMatcherWorker::Run() and terminate the process, which also kills pycolmap sessions and the GUI. - FeatureMatcherWorker catches the exception and stores it in FeatureMatcherData::error. Jobs with an error pass through the verifier and guided matching workers untouched. - FeatureMatcherController::Match() drops the queued pairs (JobQueue::Clear() now returns the number of cleared jobs), waits for the pairs in flight, writes their results, and rethrows the first error. - Thread captures the exceptions of Run() and Wait() rethrows them in the waiting thread, since the controllers themselves run in threads. A thread that fails before signaling its setup unblocks CheckValidSetup(). pycolmap therefore raises a Python exception, and the GUI shows an error dialog.
FlexGlue (https://github.com/cvg/FlexGlue) matches the keypoints of any extractor through dense image features. Since the dense features are computed from the image pixels, the matcher reads the images during matching (the image name is now passed in FeatureMatcher::Image) and caches the dense features of the most recently used images. Pairs whose covisibility score is below min_covisibility are rejected inside the model, which suppresses look-alike pairs. On CUDA, a float16 variant of the matcher is used by default. On the CPU, a single matching worker runs the models with all threads. Adds the FLEXGLUE matcher type, FlexGlueMatching.* options, the '--feature flexglue' preset of automatic_reconstructor (DaD keypoints, as the LoMa presets), pycolmap bindings, a GUI entry, documentation, and tests.
When the FlexGlue models run on a CUDA GPU, the descriptor writes the dense features directly to GPU memory through an ONNX Runtime I/O binding, and the cache keeps them there, so that the matcher reads them without copying both 4MB feature maps to the GPU for every pair (about 2 ms per pair). The GPU memory is bounded by feature_cache_size (~4MB per image). Adds an ONNXModel::Run overload whose outputs are allocated in a given memory.
The default matcher models now stop early on pairs that are confidently not covisible: after layers 2, 4, 6 and 8, a pair is rejected without running the remaining layers if its covisibility score is below min_covisibility * (1 - early_stop_decay)^(9 - layer). Adds the FlexGlueMatching.early_stop_decay option (default 0.5; 1 disables it), which is passed to matchers that support it. The new models are exported with fused GELU operators and early stopping by onnx/export.py from cvg/FlexGlue.
sarlinpe
force-pushed
the
sarlinpe/flexglue-early-stop
branch
from
October 29, 2026 07:27
bbe1e82 to
1b43529
Compare
sarlinpe
force-pushed
the
sarlinpe/flexglue-device-features
branch
2 times, most recently
from
October 29, 2026 23:27
99e01e1 to
9b1d4e4
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #4915 (GPU feature cache) and #4908.
Summary
The default FlexGlue matcher models now stop early on pairs that are confidently not covisible:
min_covisibility * (1 - early_stop_decay)^(9 - layer).FlexGlueMatching.early_stop_decaydefaults to 0.5. 1 disables it, as doesmin_covisibility = 0.early_stop_decayis a required input of the matcher models, as in the new default models.The new models are exported by cvg/FlexGlue#7 (stacked on cvg/FlexGlue#6, fused GELU):
Ifnodes built on the exported graph. The GELUs use ONNX Runtime's fused operator.flexglue_matcher_early_stop.onnxandflexglue_matcher_early_stop_fp16.onnx. The descriptor is unchanged.early_stop_decay = 1, they give the same matches as before. fp32 on CPU matches the PyTorch reference exactly; fp16 differs by at most 2 matches per pair.The models are in the FlexGlue v0.1 release and are exported by cvg/FlexGlue#7.
Do the ONNX
Ifnodes actually skip the remaining blocks? Yes.fp16, N = 2048, ONNX Runtime 1.23, A100, device I/O:
How much do we gain?
Setup:
early_stop_decay=1.min_covisibilityearly_stop_decay=0.5The gain is larger at 8k, because the readout that a stop skips costs more with more keypoints.
Over all exhaustive pairs (per-layer covisibility scores of every pair, with the time per layer measured above):
min_covisibilityThe whole stack (#4915 + this PR), with defaults
Same benchmark:
With
min_covisibility=0.8, the stack takes 50.3 ms/pair at 2k (−10.1%) and 58.0 ms/pair at 8k (−15.3%).Tests: 29/29
feature/,controllers/andutil/onnxtests pass, including the newFlexGlueTest.EarlyStopping.