-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add XFeat support with ONNX #3593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Maybe you can consider adding xfeat? I have been playing around with aliked and xfeat. In general, aliked seems to be better. But if there is no GPU, xfeat is significantly faster to extract (and to match). |
|
Thanks for the suggestion. ALIKED is a bit of a nightmare to convert to ONNX anyway because of custom layers. XFeat was easier and seems to work. I'll push this a bit further in the next days. Will let you know if I am done @tsattler. Grüsse! |
|
@tsattler Did you try xfeat for SFM as well or just for localization? Any suggested parameters for the extractor and for cosine similarity threshold during matching? Initial experiments show not so great performance on simple datasets because of very easy confusion of similar looking structure. |
|
OK, a cosine similarity threshold of 0.9 seems to do more reasonably. Still interested if you have done some more structured sweeping of parameters. |
|
We experimented with different learned features in the context of SfM. Will send you the current state to your demuc email.
I am personally using xfeat with lightglue on my MacBookAir when doing reconstructions locally. That works quits well for me.
…________________________________
From: Johannes Schönberger ***@***.***>
Sent: Wednesday, August 27, 2025 8:33:02 PM
To: colmap/colmap ***@***.***>
Cc: Sattler, Torsten ***@***.***>; Mention ***@***.***>
Subject: Re: [colmap/colmap] Add XFeat/LighterGlue support with ONNX (PR #3593)
[https://avatars.githubusercontent.com/u/134307?s=20&v=4]ahojnnes left a comment (colmap/colmap#3593)<#3593 (comment)>
@tsattler<https://github.com/tsattler> Did you try xfeat for SFM as well or just for localization? Any suggested parameters for the extractor and for cosine similarity threshold during matching? Initial experiments show not so great performance on simple datasets because of very easy confusion of similar looking structure.
—
Reply to this email directly, view it on GitHub<#3593 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABOQPGW3QVWB62TA3VETMY33PX2V5AVCNFSM6AAAAACESFNVA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMRZGMYTANZYGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Feature matching fails when --XFeatExtraction.min_score is set above 0. It appears the matcher can't handle a mismatch in feature counts. |
|
@xiemeilong Thank you. I noticed the same already. Something is wrong with the latest ONNX model conversion. Not sure what it is though. |
|
Thank you for the implementation.
Should I open a separate issue for this? |
|
Thanks @Dawars for the feedback, glad that it works for you. There is some additional work needed to enable vocab tree training + retrieval for float features. It's not too much work. I also did some testing with xfeat and found that it is much more prone to symmetric structures, where it very easily matches repeating windows on the same facades or the opposite facade. This is at least the case with the current default parameters. Did you tweak any of these in your experiments? See example below. |
|
@tsattler Did you observe the same issue? Any suggested mitigation strategies? Tweaking the cosimilarity threshold does not really work for me, as increasing it removes the symmetric pairs but also breaks the reconstruction into multiple parts. |
|
Thanks for the great work. I really enjoy using COLMAP in my projects. I've been using xfeat+lighterglue for feature extraction and matching. The extracted and matched features are manually imported into a database before running COLMAP's pose-prior mapper. Shout out to another excellent work, hloc. Because I have pre-computed camera poses by fusing other sensor data (GNSS and LiDAR), I can limit the number of image pairs for feature matching, thereby reducing the possibility of erroneous matches between physically distant features. COLMAP could also have an optional feature to pre-compute pairs of similar-looking images for feature matching, which may complement |
|
I have seen issues with similar structures before with XFeat (e.g., the Barn scene from the Tanks & Temples benchmark). Using Lighterglue / Lightglue for matching resolved this issue for me as the correctly connected parts get significantly more matches. |
|
Thanks for the feedback. I'll give LighterGlue a try and see if it can be easily converted to ONNX. |
|
You can try it yourself. I pushed the required changes to this branch. Just pass |
|
I did a parameter sweep over |
FWIW learned matching is much more prone to failure on symmetries than SIFT (high recall but lower precision) but I've never seen this happening on South Building... If one has to run both SIFT and xfeat and pick the best, it becomes pretty inconvenient... |
|
I ran through our ETH3D benchmarking suite and metrics also don't look great. The baseline (A) is SIFT with medium quality settings and the comparison (B) is this branch with default parameters: |
|
Looks like we have to make ALIKED+LightGlue work with ONNX. ALIKED is blocked on the following issue: fabio-sim/LightGlue-ONNX#103 - I don't have time to dig deep into the issue. |
|
I use the following settings for my project.
Feel free to let me know if there is anything I can contribute. |
|
@ahojnnes does this seem like a viable alternative to the onnx runtime? |
|
@reynoldscem-oculo Thank you. There is an existing pull request integrating this here: #3068 - There are, unfortunately, several issues with the implementation and portability across platforms. |
|
@ahojnnes ah yes I see! Thanks for the context. |
No description provided.