colmap / colmap

COLMAP - Structure-from-Motion and Multi-View Stereo
https://colmap.github.io/
Other
7.67k stars 1.52k forks source link

Use external visual words in addition to VisualIndex:Quantize() #287

Closed insikk closed 6 years ago

insikk commented 6 years ago

Hello, colmap maintainers :) I am glad to find out this repository. It contains every component that can be used out-of-box to build customized SfM pipeline. Evenmore, it ships image retrieval component.

My main issue here is flexibility of image retrieval component. I cannot load pre-trained visual words on this component

Right now, I am reproducing your another work "vote-and-verify": https://github.com/vote-and-verify/vote-and-verify. I want to do experiment with different dataset with different vocabulary size.

I think one must to try many different learned visual words (vocab_size, train_data, ... etc) to get best performance on the task on one's hand.

Therefore, adding loading trained visual words will be valuable feature for this repository.

I am considering directly update visual_words_ with trained visual words. (related code lines) Is it safe to do that? I don't know much about advanced BoW image retrieval system that you used here. So I am worrying about it may break Hamming embedding part. On code-level, I see no interference. But, still professional opinion is worth.

After finishing adding this feature, I'll send PR.

ahojnnes commented 6 years ago

How do you pretrain your vocabulary tree? Note that you can also train a vocabulary using COLMAP from the command line using the “vocab_tree_builder” command.

insikk commented 6 years ago

provided train method is very slow. I am trying it on Paris6k with vocab size 200k. after 9 hours still running.

If I can use PQKmeans clustering. I can do it within an hour.

slow vocab building process is my main concern.

On Jan 30, 2018 13:04, "Johannes Schönberger" notifications@github.com wrote:

How do you pretrain your vocabulary tree? Note that you can also train a vocabulary using COLMAP from the command line using the “vocab_tree_builder” command.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/colmap/colmap/issues/287#issuecomment-361470818, or mute the thread https://github.com/notifications/unsubscribe-auth/ACAzl79GW1xPh_r09nojljXbPx5XWp3Sks5tPpTrgaJpZM4RwiTY .

ahojnnes commented 6 years ago

I have never trained the vocabulary externally, but I cannot think of a reason why this should not work. The Hamming embedding just uses a random projection matrix, which could be regenerated for different databases.

insikk commented 6 years ago

@ahojnnes Thank you for your comment. I'll try to implement this feature to give flexibility of using external vocabulary.

chongyaaa commented 2 years ago

@ahojnnes感谢您的评论。我将尝试实现此功能以提供使用外部词汇的灵活性。

I'll try to implement this feature to give flexibility of using external vocabulary.Did you implement this function?