cvg / Hierarchical-Localization

Visual localization made easy with hloc
Apache License 2.0
3.24k stars 599 forks source link

Pipeline for custom data #315

Open SagarB-97 opened 1 year ago

SagarB-97 commented 1 year ago

I was looking to use hloc for following usecase which is not uncommon in vision-based localization:

However, I think the examples provided don't directly address this usecase, as they are mostly written to evaluate hloc on datasets. As a result, the reference images and query images are tightly coupled. For example, in pipeline_Aachen.ipynb, the features for both the reference and query images are extracted together. Localizing query images wihtout updating the ground-truth data (eg. features db) requires changing the code. While the notebook demo.ipynb achieves something to this effect, it uses exhaustive matching which is impractical for most usecases. I have added pipeline_custom.ipynb that demonstrates how to use hloc for one's own data (with some very small changes to the hloc APIs).

If this is useful, I can add more documentation on how to generate one's own data (eg. generating colmap SfM model) if needed.