Skip to content

Conversation

@ahojnnes
Copy link
Contributor

@ahojnnes ahojnnes commented Dec 12, 2024

This PR adds automatic download and caching functionality for vocabulary trees. Sample output:

$ colmap vocab_tree_matcher --database_path ~/data/south-building/database.db
I20241212 18:17:51.708911 427449 misc.cc:44] 
==============================================================================
Feature matching
==============================================================================
I20241212 18:17:51.724920 427450 sift.cc:1426] Creating SIFT GPU feature matcher
I20241212 18:17:51.755941 427449 pairing.cc:234] Generating image pairs with vocabulary tree...
I20241212 18:17:51.756253 427449 file.cc:356] Downloading file from: https://github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_flickr100K_words256K.bin
I20241212 18:17:56.891381 427449 file.cc:361] Caching file at: "/Users/jsch/.cache/colmap/vocab_tree_flickr100K_words256K.bin"
I20241212 18:17:57.423804 427449 pairing.cc:355] Indexing image [1/128]
...

$ colmap vocab_tree_matcher --database_path ~/data/south-building/database.db
I20241212 18:18:02.601915 427813 misc.cc:44] 
==============================================================================
Feature matching
==============================================================================
I20241212 18:18:02.614478 427814 sift.cc:1426] Creating SIFT GPU feature matcher
I20241212 18:18:02.639487 427813 pairing.cc:234] Generating image pairs with vocabulary tree...
I20241212 18:18:03.135216 427813 pairing.cc:355] Indexing image [1/128]
...

Copy link
Member

@sarlinpe sarlinpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the documentation accordingly?

@ahojnnes ahojnnes enabled auto-merge (squash) December 13, 2024 15:52
@ahojnnes ahojnnes disabled auto-merge December 13, 2024 16:00
@ahojnnes ahojnnes enabled auto-merge (squash) December 13, 2024 16:15
@ahojnnes ahojnnes merged commit 023dd9a into main Dec 13, 2024
16 checks passed
@ahojnnes ahojnnes deleted the user/jsch/vocab-tree-download branch December 13, 2024 16:40
HernandoR pushed a commit to HernandoR/colmap that referenced this pull request Dec 30, 2024
This PR adds automatic download and caching functionality for vocabulary
trees. Sample output:
```
$ colmap vocab_tree_matcher --database_path ~/data/south-building/database.db
I20241212 18:17:51.708911 427449 misc.cc:44] 
==============================================================================
Feature matching
==============================================================================
I20241212 18:17:51.724920 427450 sift.cc:1426] Creating SIFT GPU feature matcher
I20241212 18:17:51.755941 427449 pairing.cc:234] Generating image pairs with vocabulary tree...
I20241212 18:17:51.756253 427449 file.cc:356] Downloading file from: https://github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_flickr100K_words256K.bin
I20241212 18:17:56.891381 427449 file.cc:361] Caching file at: "/Users/jsch/.cache/colmap/vocab_tree_flickr100K_words256K.bin"
I20241212 18:17:57.423804 427449 pairing.cc:355] Indexing image [1/128]
...

$ colmap vocab_tree_matcher --database_path ~/data/south-building/database.db
I20241212 18:18:02.601915 427813 misc.cc:44] 
==============================================================================
Feature matching
==============================================================================
I20241212 18:18:02.614478 427814 sift.cc:1426] Creating SIFT GPU feature matcher
I20241212 18:18:02.639487 427813 pairing.cc:234] Generating image pairs with vocabulary tree...
I20241212 18:18:03.135216 427813 pairing.cc:355] Indexing image [1/128]
...
```
@Matt-V50
Copy link
Contributor

Matt-V50 commented Jul 6, 2025

I believe this issue is related to this commit.

The download link is the default setting

https://github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_faiss_flickr100K_words256K.bin;vocab_tree_faiss_flickr100K_words256K.bin;96ca8ec8ea60b1f73465aaf2c401fd3b3ca75cdba2d3c50d6a2f6f760f275ddc
I20250705 22:15:12.079672 133632217839168 pairing.cc:404] Generating sequential image pairs...
I20250705 22:15:12.081659 133632217839168 pairing.cc:238] Generating image pairs with vocabulary tree...
I20250705 22:15:12.081687 133632217839168 file.cc:447] Downloading file from: https://github.com/colmap/colmap/releases/download/3.11.1/vocab_tree_faiss_flickr100K_words256K.bin
E20250705 22:15:12.100522 133632217839168 file.cc:449] Check failed: blob.has_value() Failed to download file
terminate called after throwing an instance of 'std::invalid_argument'
  what():  [file.cc:449] Check failed: blob.has_value() Failed to download file
*** Aborted at 1751768112 (unix time) try "date -d @1751768112" if you are using GNU date ***
PC: @     0x798a29e969fc pthread_kill
*** SIGABRT (@0x3e80003e90c) received by PID 256268 (TID 0x7989acdff640) from PID 256268; stack trace: ***
    @     0x798a29e99ee8 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x99ee7)
    @     0x7989b0593958 (/home/matt/miniconda3/envs/colmap/lib/python3.10/site-packages/pycolmap/_core.cpython-310-x86_64-linux-gnu.so+0x993957)
    @     0x798a29e42520 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x4251f)
    @     0x798a29e969fc pthread_kill
    @     0x798a29e42476 raise
    @     0x798a29e287f3 abort
    @     0x798a25d220d9 __gnu_cxx::__verbose_terminate_handler()
    @     0x798a25d206bb __cxxabiv1::__terminate(void (*)())
    @     0x798a25d1a0e3 std::terminate()
    @     0x798a25d208be __cxa_throw
    @     0x7989b013438c (/home/matt/miniconda3/envs/colmap/lib/python3.10/site-packages/pycolmap/_core.cpython-310-x86_64-linux-gnu.so+0x53438b)
    @     0x7989b14513cb colmap::MaybeDownloadAndCacheFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    @     0x7989b0b29566 colmap::retrieval::VisualIndex::Read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    @     0x7989b0ae0422 colmap::VocabTreePairGenerator::VocabTreePairGenerator(colmap::VocabTreeMatchingOptions const&, std::shared_ptr<colmap::FeatureMatcherCache> const&, std::vector<unsigned int, std::allocator<unsigned int> > const&)
    @     0x7989b0ae52cf colmap::SequentialPairGenerator::SequentialPairGenerator(colmap::SequentialMatchingOptions const&, std::shared_ptr<colmap::FeatureMatcherCache> const&)
    @     0x7989b0a5e237 (/home/matt/miniconda3/envs/colmap/lib/python3.10/site-packages/pycolmap/_core.cpython-310-x86_64-linux-gnu.so+0xe5e236)
    @     0x7989b0a5f898 (/home/matt/miniconda3/envs/colmap/lib/python3.10/site-packages/pycolmap/_core.cpython-310-x86_64-linux-gnu.so+0xe5f897)
    @     0x7989b145d722 colmap::Thread::RunFunc()
    @     0x798a25d3d198 execute_native_thread_routine
    @     0x798a29e94ac3 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x94ac2)
    @     0x798a29f26850 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x12684f)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants