lightglue
Use LightGlue for local feature matching, extractor selection, matcher configuration, visualization, and benchmarking.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- lightglue
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use LightGlue for local feature matching, extractor selection, matcher configuration, visualization, and benchmarking.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md4.6 KB
- 参考文档references/repo-provenance.md1.7 KB
- 参考文档references/repo-routing-metadata.json336 B
- 参考文档references/troubleshooting.md5.4 KB
- 脚本scripts/lightglue_smoke.py5.1 KB
03 SKILL.md 正文
LightGlue
Use this repo skill when a task involves LightGlue local feature matching: matching two images, choosing a supported feature extractor, validating feature dictionaries, configuring the matcher, plotting matches/pruning, or benchmarking latency.
LightGlue is an inference package for sparse local feature matching. It extracts or consumes keypoints/descriptors for two images and returns mutual correspondences plus scores and adaptive-depth/pruning diagnostics.
First checks
Install the public package or a local checkout with its runtime dependencies:
python -m pip install git+https://github.com/cvg/LightGlue.git
# or, in a local checkout:
python -m pip install -e .
Minimal import check:
from lightglue import LightGlue, SuperPoint, DISK, SIFT, ALIKED, DoGHardNet, match_pair
from lightglue.utils import load_image, rbd
Download-free API smoke check from this skill:
python scripts/lightglue_smoke.py --device cpu
This smoke check validates imports and synthetic tensor shapes with features=None; it does not validate pretrained matching quality.
Route by task
| If the user asks to... | Read |
|---|---|
Match two image files, save a match plot, use match_pair, or interpret coordinate correspondences. |
sub-skills/image-pair-matching/SKILL.md |
| Choose/configure SuperPoint, DISK, ALIKED, SIFT, or DoGHardNet, or validate precomputed feature dictionaries. | sub-skills/extractors-and-features/SKILL.md |
Call LightGlue directly, set thresholds, use features=None, disable adaptivity, compile, or interpret output keys. |
sub-skills/matcher-configuration/SKILL.md |
Benchmark latency/throughput, use FlashAttention or torch.compile, tune pruning thresholds, or plot matches/keypoints/pruning. |
sub-skills/performance-and-visualization/SKILL.md |
Shared references and scripts
- references/package-overview.md: package purpose, dependencies, public entry points, feature families, first-use weights, and backend stance.
- references/troubleshooting.md: cross-cutting install/import, network/cache, backend, and data-shape failures.
- references/repo-provenance.md: source commit, package version, evidence paths, and refresh baseline.
- references/repo-routing-metadata.json: structured scenario metadata for repo-skill routing.
- scripts/lightglue_smoke.py: deterministic import and synthetic matcher smoke check with no pretrained downloads.
Operating defaults
- Use
SIFTfor offline feature-schema checks because the default OpenCV SIFT extractor does not download neural weights. - Use feature-specific matcher presets (
features="superpoint","disk","aliked","sift", or"doghardnet") for real pretrained matching; they may download matcher weights on first use. - Use
features=Noneonly for precomputed/custom descriptors or API smoke checks. Random/untrained weights are not a matching-quality proof. - CPU is adequate for import checks, schema validation, and tiny smoke tests. CUDA/MPS/FlashAttention are optional acceleration paths, not required package semantics.
- Do not send users to original repo files for runtime instructions; use the bundled references and scripts in this skill tree.
Non-goals
This skill does not cover training LightGlue from scratch, full structure-from-motion/localization pipelines, third-party ONNX/TensorRT export projects, or generic computer-vision tasks unrelated to local feature matching.
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).