hierarchical-localization
Use the hloc Hierarchical-Localization toolbox for visual localization, feature retrieval, matching, SfM mapping, dataset pipelines, and custom HDF5 interoperability.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- hierarchical-localization
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use the hloc Hierarchical-Localization toolbox for visual localization, feature retrieval, matching, SfM mapping, dataset pipelines, and custom HDF5 interoperability.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/repo-provenance.md1.9 KB
- 参考文档references/repo-routing-metadata.json450 B
- 参考文档references/troubleshooting.md6.0 KB
- 参考文档references/workflow-recipes.md5.1 KB
- 脚本scripts/check_hloc_environment.py6.5 KB
03 SKILL.md 正文
Hierarchical-Localization (hloc)
Use this repo skill when a task involves the hloc visual localization toolbox: 6-DoF image localization, image retrieval pairs, local feature extraction, SuperPoint/SuperGlue/LightGlue/LoFTR workflows, pycolmap/COLMAP SfM models, Aachen or InLoc pipelines, or HDF5 feature/match interoperability.
Install and import check
hloc is a Python package whose distribution name and import name are both hloc. It requires Python, PyTorch/torchvision, OpenCV, NumPy/SciPy/HDF5 tooling, pycolmap, kornia, and other runtime dependencies. Learned extractors and matchers can download model weights on first use; CUDA accelerates many models but is not required for parser/import/data-format checks.
Minimal check in the user's active environment:
python -c "import hloc; print(hloc.__version__)"
python -m hloc.extract_features --help
python -m hloc.reconstruction --help
For a fuller safe diagnostic, run the bundled helper:
python scripts/check_hloc_environment.py --check-cli
Route by task
- Load feature-retrieval for built-in local/global feature extraction, NetVLAD-style retrieval descriptors, sparse/dense matching, exact config names, output file naming, and feature/match HDF5 schemas.
- Load mapping-localization for pair generation, reconstruction, triangulation, COLMAP/pycolmap model folders,
localize_sfm,localize_inloc, query pose outputs, and localization logs. - Load dataset-pipelines for Aachen, Aachen v1.1, InLoc, SfM demo, 4Seasons, 7Scenes, CMU, Cambridge, or RobotCar planning. These workflows usually require external datasets and should not be launched as routine smoke tests.
- Load custom-interop for external feature/global-descriptor/match HDF5 files, new extractor or matcher modules,
BaseModel/dynamic_load, list/pair/pose schemas, and custom artifact validation.
Canonical workflow shape
Most HLoc tasks combine multiple routes:
- Choose feature/retrieval/matcher configs and produce feature or descriptor HDF5 files (
feature-retrieval). - Generate database or query pairs from retrieval, covisibility, poses, or exhaustive combinations (
mapping-localization). - Match selected image pairs and validate HDF5 pair groups (
feature-retrievalplusmapping-localization). - Reconstruct or triangulate a reference SfM model with pycolmap (
mapping-localization). - Retrieve and match database images for each query (
feature-retrieval). - Localize query images and inspect pose/log outputs (
mapping-localization). - When the request names a public benchmark dataset, first read
dataset-pipelinesto verify the dataset layout and skip network/benchmark-scale surprises.
Read references/workflow-recipes.md for cross-sub-skill pipeline recipes before composing a long command sequence.
Public runtime references and helpers
- references/repo-provenance.md records the source commit, package version, evidence paths, and refresh baseline.
- references/repo-routing-metadata.json contains structured managed-router metadata for this skill.
- references/workflow-recipes.md summarizes generic SfM/localization, tiny demo-style, dataset, and custom-interoperability flows.
- references/troubleshooting.md covers install/import, model-download, CPU/GPU, pycolmap, artifact naming, and dataset-scale safety issues shared by multiple routes.
- scripts/check_hloc_environment.py checks installed
hlocimports, versions, configs, optional CUDA status, and safe CLI parsers without running model inference or downloading data.
Safety and boundary rules
- Do not treat full Aachen/InLoc/RobotCar/CMU/4Seasons/Cambridge/7Scenes runs as safe smoke tests; they require external datasets, large outputs, and often model downloads.
- Do not assume CUDA is required. Verify the user's goal: CUDA is usually for speed, while CPU can validate imports, parsers, schemas, and many small logic checks.
- Keep image names consistent across lists, HDF5 groups, pair files, SfM model images, retrieval files, and pose outputs. Name mismatches are the most common cross-workflow failure.
- Prefer bundled validators and references from this skill over reopening a source checkout. If public APIs or configuration names differ from the provenance snapshot, run
refresh-repo-skill.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).