cvg/glue-factory is an AI-powered project on GitHub with 1.1k stars, written primarily in Python. Training library for local feature detection and matching
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Some advanced features might require installing the full set of dependencies:
python3 -m pip install -e .[extra]
All models and datasets in gluefactory have auto-downloaders, so you can get started right away!
License
The code and trained models in Glue Factory are released with an Apache-2.0 license. This includes LightGlue and an open version of SuperPoint. Third-party models that are not compatible with this license, such as SuperPoint (original) and SuperGlue, are provided in gluefactory_nonfree, where each model might follow its own, restrictive license.
Evaluation
HPatches
Running the evaluation commands automatically downloads the dataset, by default to the directory data/. You will need about 1.8 GB of free disk space.
[Evaluating LightGlue]
To evaluate the pre-trained SuperPoint+LightGlue model on HPatches, run:
Setting eval.ransac_th=-1 auto-tunes the RANSAC inlier threshold by running the evaluation with a range of thresholds and reports results for the optimal value.
Here are the results as Area Under the Curve (AUC) of the homography error at 1/3/5 pixels:
Since we use points and lines to solve for the homography, we use a different robust estimator here: Hest. Here are the results as Area Under the Curve (AUC) of the homography error at 1/3/5 pixels:
Methods
DLT
Hest
SP + LSD + GlueStick
33.6 / 66.4 / 77.1
39.2 / 69.7 / 79.6
MegaDepth-1500
Running the evaluation commands automatically downloads the dataset, which takes about 1.5 GB of disk space.
[Evaluating LightGlue]
To evaluate the pre-trained SuperPoint+LightGlue model on MegaDepth-1500, run:
python -m gluefactory.eval.megadepth1500 --conf superpoint+lightglue-official
# or the adaptive variant
python -m gluefactory.eval.megadepth1500 --conf superpoint+lightglue-official \
model.matcher.{depth_confidence=0.95,width_confidence=0.95}
The first command should print the following results
All current benchmarks are supported by the viewer.
Detailed evaluation instructions can be found here.
Training
We generally follow a two-stage training:
Pre-train on a large dataset of synthetic homographies applied to internet images. We use the 1M-image distractor set of the Oxford-Paris retrieval dataset. It requires about 450 GB of disk space.
Fine-tune on the MegaDepth dataset, which is based on PhotoTourism pictures of popular landmarks around the world. It exhibits more complex and realistic appearance and viewpoint changes. It requires about 420 GB of disk space.
All training commands automatically download the datasets.
[Training LightGlue]
We show how to train LightGlue with SuperPoint.
We first pre-train LightGlue on the homography dataset:
python -m gluefactory.train sp+lg_homography \ # experiment name
--conf gluefactory/configs/superpoint+lightglue_homography.yaml
Feel free to use any other experiment name. By default the checkpoints are written to outputs/training/. The default batch size of 128 corresponds to the results reported in the paper and requires 2x 3090 GPUs with 24GB of VRAM each as well as PyTorch >= 2.0 (FlashAttention).
Configurations are managed by OmegaConf so any entry can be overridden from the command line.
If you have PyTorch < 2.0 or weaker GPUs, you may thus need to reduce the batch size via:
Here the default batch size is 32. To speed up training on MegaDepth, we suggest to cache the local features before training (requires around 150 GB of disk space):
# extract features
python -m gluefactory.scripts.export_megadepth --method sp --num_workers 8
# run training with cached features
python -m gluefactory.train sp+lg_megadepth \
--conf gluefactory/configs/superpoint+lightglue_megadepth.yaml \
train.load_experiment=sp+lg_homography \
data.load_features.do=True
The model can then be evaluated using its experiment name:
Note that we used the training splits train_scenes.txt and valid_scenes.txt to train the original model, which contains some overlap with the IMC challenge. The new default splits are now train_scenes_clean.txt and valid_scenes_clean.txt, without this overlap.
Available models
Glue Factory supports training and evaluating the following deep matchers:
More baselines (LoFTR, ASpanFormer, MatchFormer, SGMNet, DKM, RoMa)
Training deep detectors and descriptors like SuperPoint
IMC evaluations
Better documentation
BibTeX Citation
Please consider citing the following papers if you found this library useful:
@InProceedings{lindenberger_2023_lightglue,
title = {{LightGlue: Local Feature Matching at Light Speed}},
author = {Philipp Lindenberger and
Paul-Edouard Sarlin and
Marc Pollefeys},
booktitle = {International Conference on Computer Vision (ICCV)},
year = {2023}
}
@InProceedings{pautrat_suarez_2023_gluestick,
title = {{GlueStick: Robust Image Matching by Sticking Points and Lines Together}},
author = {R{\'e}mi Pautrat* and
Iago Su{\'a}rez* and
Yifan Yu and
Marc Pollefeys and
Viktor Larsson},
booktitle = {International Conference on Computer Vision (ICCV)},
year = {2023}
}
No homepage URL was recorded for cvg/glue-factory in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How active is development on cvg/glue-factory?
The most recent commit recorded on cvg/glue-factory was 1 month ago, based on the GitHub push timestamp. The repository has 157 forks — one of the better signals of community interest.
Is cvg/glue-factory open source?
Yes — cvg/glue-factory ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/cvg/glue-factory.
What license does cvg/glue-factory use?
cvg/glue-factory is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is cvg/glue-factory associated with?
GitHub's repository topics for cvg/glue-factory: "computer-vision", "deep-learning", "iccv2023", "image-matching". TopGit's editorial category is AI Tools.
Where do I read more about cvg/glue-factory?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/cvg/glue-factory is the definitive source.
Read full README in the tab above.
Still deciding about glue-factory?
One click hands the question to an AI along with this page — see what it says about glue-factory.