Local feature matching at light speed
open sourceApache-2.0self-hostablefree
LightGlue is a deep neural network that matches sparse local features between two images (ICCV 2023), from ETH Zurich's Computer Vision and Geometry Group. Given keypoints and descriptors for each image it returns the indices of corresponding points, and it adapts its depth and width per image pair: easy pairs stop after a few layers and unmatchable points are pruned early, which makes it 4 to 10 times faster than SuperGlue. Pretrained weights cover SuperPoint, DISK, ALIKED and SIFT features. LightGlue's code and weights are Apache-2.0, but SuperPoint is under Magic Leap's non-commercial licence, so commercial users pick DISK, ALIKED or SIFT. It's also available in Hugging Face Transformers, Kornia and OpenCV 5, and trained with the group's Glue Factory.
Problems it solves
- match keypoints between two images faster than SuperGlue without losing accuracy
- replace brute-force descriptor matching and ratio tests with a learned matcher that rejects outliers
- learned feature matcher I can use in a commercial product without a non-commercial licence
- register a photographed page against a reference scan using matched local features
- speed up structure-from-motion or visual localization by swapping in a faster matcher
- match SIFT features better without changing my existing keypoint extractor
- real-time feature matching on a GPU for AR or robotics
- export a feature matcher to ONNX or TensorRT for deployment
- train a feature matcher on my own dataset and local features
- image matching that spends less compute on easy image pairs and more on hard ones
Features
- matches sparse keypoints and descriptors and returns corresponding point indices with scores
- pretrained weights for SuperPoint, DISK, ALIKED, SIFT and DoGHardNet features
- adaptive depth (early stopping) and width (point pruning) per image pair
- FlashAttention, mixed precision and torch.compile support
- match_pair convenience function for two images
- benchmark script for GPU and CPU
- in Hugging Face Transformers (LightGlueForKeypointMatching)
- available through Kornia's LightGlue and LightGlueMatcher
- part of OpenCV 5's Features module
- training and evaluation in Glue Factory
Limitations
- SuperPoint features not licensed for commercial use: SuperPoint and the LightGlue weights trained on it are non-commercial research only; DISK, ALIKED and SIFT aren't123
Capabilities
| Has official SDKs | plan not known |
|---|
Alternatives
The same job
These do what LightGlue does.
