fix(process_data): use faiss vocab tree for COLMAP >= 3.12.0 - #3777
Open
wyyyz1937365497 wants to merge 3 commits into
Open
fix(process_data): use faiss vocab tree for COLMAP >= 3.12.0#3777wyyyz1937365497 wants to merge 3 commits into
wyyyz1937365497 wants to merge 3 commits into
Conversation
COLMAP switched from FLANN to faiss for vocabulary tree indexing in 3.12.0 (June 2025). The FLANN-based tree that nerfstudio auto-downloads is incompatible with faiss-based COLMAP, causing `vocab_tree_matcher` (the default matching method) to crash: Check failed: file_version == 1 (32762 vs. 1) Failed to read faiss index. `get_vocab_tree()` now selects the correct tree format based on the detected COLMAP version, downloading the faiss-based tree from the official COLMAP 3.11.1 release for COLMAP >= 3.12.0 and keeping the legacy FLANN tree for older versions. Each format is cached under a distinct filename so that upgrading COLMAP never silently serves a stale tree of the wrong format. Fixes nerfstudio-project#3664
…field
`read_points3D_binary` stores `error` as a numpy array, but
`write_points3D_binary` passed it directly to `struct.pack("<d", ...)`,
which fails on numpy 2.x because 1-d arrays are no longer auto-coerced
to Python scalars. Wrap `pt.error.item()` in `float()` for robust
extraction—this matches the existing convention in
`write_cameras_binary` (line 184: `float(p)`).
Fixes a pre-existing test failure on CI where
`test_process_images_skip_colmap` and
`test_process_images_recursively_skip_colmap` crashed with
`struct.error: required argument is not a float`.
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.
Summary
ns-process-datacrashes during the defaultvocab_treefeature matching step on COLMAP >= 3.12.0, because COLMAP switched its vocabulary tree index format from FLANN to faiss in 3.12.0 (June 2025). nerfstudio auto-downloads a FLANN tree fromdemuc.de, which faiss-based COLMAP cannot read:This is reported in #3664 and affects anyone using a recent COLMAP install.
The fix
get_vocab_tree()is now version-aware:https://github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_faiss_flickr100K_words32K.bindemuc.de(unchanged behavior).Each format is cached under a distinct filename (
vocab_tree_faiss_words32K.binvsvocab_tree.fbow) so that upgrading COLMAP never silently serves a stale tree of the wrong format — the exact footgun that caused this bug.The version detection already exists in
run_colmap()viaget_colmap_version(), so this adds no new system calls.Test plan
requests.getmock that COLMAP 3.12.6 selects the faiss URL/filename and COLMAP 3.11.1 selects the FLANN URL/filename.ruff format+ruff checkclean.colmap vocab_tree_matchercommand runs to completion on a real dataset after swapping to the faiss tree.Fixes #3664