Python toolbox for hierarchical visual localization using image retrieval, feature matching, and structure-from-motion. Reproduces benchmark pipelines and supports custom features.
Overview
Hierarchical Localization (hloc) is a modular Python toolbox for six-degree-of-freedom visual localization. It implements the hierarchical localization approach that combines image retrieval with local feature matching, and ties together research components for matching and structure-from-motion.
Typical workflows build or reuse a reference 3D model, retrieve relevant database images for each query, match query images to the map, run pose estimation, and optionally visualize or debug results. It integrates with COLMAP through pycolmap in recent releases and can run end-to-end in environments such as Google Colab with GPU access.
The package exposes command-line scripts and a Python import interface. It ships pipelines for several public localization datasets and lets researchers plug in custom local features, matchers, or global descriptors by following documented HDF5 layouts or PyTorch model interfaces.
Key features
- Hierarchical localization pipelines
- Feature extraction and matching front ends
- Image retrieval integration
- COLMAP-based SfM reconstruction
- Dataset-specific pipeline scripts
- Pickle logs for debugging matches
- 3D model visualization utilities
- Custom feature and matcher hooks
Use cases
- Outdoor and indoor visual localization benchmarks
- SfM map building for custom image sets
- Evaluating new local features for localization
- Research prototypes for pose estimation