Glue Factory: a training harness for local feature matchers
Training library for local feature detection and matching
At a glance
- What is it?
- Glue Factory packages the training and evaluation code behind LightGlue and GlueStick. It is built for people who already have a matcher idea and need a place to train and benchmark it, not for people who just want to run inference.
- Who is it for?
- Adopt Glue Factory if you are training or benchmarking a point or line matcher and want the LightGlue and GlueStick pipelines plus HPatches and MegaDepth-1500 evaluation in one repository. Do not adopt it if you only need to run a pretrained matcher on your own images; the repository is organised around training configs and benchmark scripts, not deployment.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 58 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The gap Glue Factory fills between a matcher paper and a reusable training loop
Most local feature projects publish a model and an inference script. Reproducing the training is a separate effort, and the datasets, the loss, the keypoint sampling and the evaluation protocol are usually spread across a paper and a private codebase. Glue Factory is the CVG group's attempt to publish that second half. The README describes it as a library for training and evaluating deep neural networks that extract and match local visual features, and it lists three capabilities: reproducing training of models such as LightGlue and GlueStick, training those models on multiple datasets with your own local features or lines, and evaluating extractors or matchers on HPatches and MegaDepth-1500.
The intended user is someone who has a detector, a descriptor, or a matching head and wants to know whether it beats SuperPoint+LightGlue under a fixed protocol. That is a narrower audience than the inference libraries it sits next to. If you never intend to run a training job, the parts of this repository you would use are the evaluation entry points and the pretrained configs, and the rest is overhead.
Configs, auto-downloaders and modular estimators: how the pieces fit
The repository is organised around YAML configs in gluefactory/configs. A config names a model combination, for example superpoint+lightglue-official.yaml or superpoint+lsd+gluestick.yaml, and the training and evaluation entry points take that config as input. This is why the README can say that all models and datasets have auto-downloaders: the entry point resolves the dataset from the config and fetches it rather than requiring a manual download step.
Evaluation is split by benchmark rather than by model. gluefactory.eval.hpatches and gluefactory.eval.megadepth1500 are separate modules, and the robust estimator is a swappable component underneath them. The repository ships several: OpenCV and PoseLib for homographies, pycolmap, OpenCV and PoseLib for relative pose, and Hest for the point-and-line case used by GlueStick. That separation matters because the estimator changes the numbers. The README's HPatches table shows SuperPoint+LightGlue scoring 34.2 / 57.9 / 69.9 AUC at 1/3/5 pixels with OpenCV and 37.1 / 67.4 / 77.8 with PoseLib, on the same model. Anyone comparing against a published result has to check which estimator produced it.
The command line also exposes config values directly, so you can override nested keys without editing files. The MegaDepth-1500 example for the adaptive LightGlue variant is model.matcher.{depth_confidence=0.95,width_confidence=0.95}, and the estimator override is eval.estimator=poselib. There is a second key, eval.ransac_th, that controls the RANSAC inlier threshold. Setting it to -1, as the README shows, auto-tunes the threshold across a range and reports the best value, which is a convenience for benchmarking but not something you would want in a fixed comparison.
Getting it installed and running the two benchmark suites
Installation is an editable pip install from a clone. The README gives:
git clone https://github.com/cvg/glue-factory cd glue-factory python3 -m pip install -e .
and then, for what it calls the full set of dependencies:
python3 -m pip install -e .[extra]
The base install is described as the library and its basic dependencies. The README does not enumerate what the extra group adds, so if a training run fails on a missing package, checking the extra group is the first place to look.
Evaluation is where the README is most concrete. On HPatches, the dataset downloads to data/ by default and needs about 1.8 GB of free space. The LightGlue command is:
python -m gluefactory.eval.hpatches --conf superpoint+lightglue-official --overwrite
The README prints the expected metric dictionary for this run, including H_error_dlt@3px of 0.6723 and mprec@3px of 0.89, which gives you a way to confirm the install is behaving. The PoseLib variant adds eval.estimator=poselib eval.ransac_th=-1.
MegaDepth-1500 needs about 1.5 GB and uses a different module:
python -m gluefactory.eval.megadepth1500 --conf superpoint+lightglue-official
GlueStick is evaluated with --conf gluefactory/configs/superpoint+lsd+gluestick.yaml on both benchmarks. Note that the HPatches GlueStick command passes a full path to the config file while the LightGlue commands pass a short name, so the config resolver accepts both forms.
The evaluation numbers depend on the estimator, so read the table before quoting it
The README's tables are the most useful part of the documentation and also the easiest to misread. On HPatches, SuperPoint+SuperGlue scores 32.1 / 65.0 / 75.7 with DLT, 32.9 / 55.7 / 68.0 with OpenCV, and 37.0 / 68.2 / 78.7 with PoseLib. The model is identical in all three columns. The spread between OpenCV and PoseLib is over four points at 1 pixel, which is larger than many of the improvements reported in matching papers.
The README acknowledges this directly, stating that the default robust estimator is opencv but that it strongly recommends poselib instead. That is an unusual thing for a project to say about its own default, and it is worth taking at face value: if you run the evaluation without overriding the estimator, you are not reproducing the numbers in the right-hand columns.
GlueStick on HPatches uses a different estimator again, Hest, because the homography is solved from points and lines together. Its table shows 33.6 / 66.4 / 77.1 with DLT and 39.2 / 69.7 / 79.6 with Hest. The MegaDepth-1500 table continues past the point where the supplied README is truncated, so the SuperPoint+LightGlue row is cut off mid-table and cannot be quoted. What is visible is that pycolmap, OpenCV and PoseLib are all offered for relative pose, with SuperPoint+SuperGlue at 54.4 / 70.4 / 82.4, 48.7 / 65.6 / 79.0 and 64.8 / 77.9 / 87.0 respectively. The same pattern holds: the estimator choice moves the result by more than most modelling changes.
The Apache-2.0 grant stops at gluefactory_nonfree
The README is explicit that the code and trained models are released under Apache-2.0, and that this includes LightGlue and an open version of SuperPoint. It then states that third-party models which are not compatible with that license, naming SuperPoint (original) and SuperGlue, are provided in gluefactory_nonfree, where each model might follow its own restrictive license.
This is a clean split and it is worth respecting. The configs directory contains superpoint+superglue-official.yaml, so a config exists for a combination whose weights are not covered by the repository's Apache-2.0 grant. If you are evaluating SuperGlue or the original SuperPoint, the license question is on you and on the upstream model, not on Glue Factory. There is no statement in the README about what the restrictive terms are; you would need to check the individual model sources. For anything you intend to ship, the safe path through this repository is LightGlue plus the open SuperPoint variant, both of which the README places under Apache-2.0.
Where Glue Factory is the wrong tool, and what to use instead
The clearest boundary is inference. If your goal is to match two images with a pretrained model and you have no interest in training, the upstream LightGlue and GlueStick repositories are the shorter path. They exist to run the model, and the README links to both. Glue Factory's value is in the training loop, the dataset plumbing and the benchmark harness; pulling in a training library to do inference adds configuration surface you will not use.
The second boundary is architectural. Glue Factory is a Python and PyTorch library installed with pip in editable mode. There is no mention of a C++ runtime, an ONNX export, or a mobile deployment path in the material provided. If your target is a production pipeline that needs a compiled matcher, this repository is the place you train the model, not the place you deploy it. The README does not describe an export step, so I cannot say whether one exists.
A third case is when your matcher does not fit the point-or-line framing. The README frames the library around local features and lines, with configs named after specific detector and matcher combinations. A dense or region-based matching method would not map onto the config structure as described.
Maintenance cost and what to check before you commit
There are no releases listed for this repository, so there is no versioned artifact to pin against. The install instruction is an editable clone of the default branch, which means your environment tracks main. For a research library that is normal, and it also means an upgrade is a git pull plus a reinstall of the editable package, with no changelog to read in advance. The last push recorded is 2026-07-20, so the project is active.
The dependency surface is the other ongoing cost. The base install is described as basic dependencies, with an extra group for advanced features, and the README does not say which features need which group. Datasets are handled by auto-downloaders, which removes a manual step but also means disk usage is a live concern: 1.8 GB for HPatches and 1.5 GB for MegaDepth-1500, per the README, before you add your own training data.
What to verify first, concretely: run the HPatches command with --conf superpoint+lightglue-official --overwrite and compare the printed mprec@3px against the 0.89 in the README. If it matches, your install, the auto-downloader and the default estimator are all behaving. Then rerun with eval.estimator=poselib eval.ransac_th=-1 and confirm you land near the PoseLib column. Those two runs tell you more about whether this library fits your setup than any amount of reading the configs.
Editorial conclusion
Adopt Glue Factory if you are training or benchmarking a point or line matcher and want the LightGlue and GlueStick pipelines plus HPatches and MegaDepth-1500 evaluation in one repository. Do not adopt it if you only need to run a pretrained matcher on your own images; the repository is organised around training configs and benchmark scripts, not deployment. Before committing, verify which models you actually need, because SuperPoint (original) and SuperGlue live in gluefactory_nonfree under their own restrictive licenses while the rest of the code and the open SuperPoint variant ship under Apache-2.0.
Community notes