Library / SDK
cvg/glue-factory avatar
cvg/glue-factory

Glue Factory: a training harness for local feature matchers

Training library for local feature detection and matching

1,172 stars159 forksPythonApache-2.0

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 125 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 November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • cvg/glue-factory1,172 ★ · +26
Star history
Repository2026-09-112026-11-22
cvg/glue-factory1.1k1.2k

26 Stars in the last 72 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial 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. 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. 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.

Frequently asked questions

What is the Glue Factory library?

A training and evaluation library for local feature extraction and matching, from the group that produced LightGlue and the line-based GlueStick matcher. It lets you reproduce training for point and line matchers, train on multiple datasets with your own local features or lines, and evaluate extractors and matchers on the HPatches and MegaDepth benchmarks, with automatic downloaders for models and datasets.

Which RANSAC estimator should I use with Glue Factory?

Not the default. The readme says the default is one estimator and strongly recommends another, and its own benchmark tables show the default scoring below plain direct linear transform on the homography task and last among three on the pose task. For the line-based matcher, a third estimator is used because the homography is solved from points and lines together.

What licenses apply to Glue Factory and the models it ships?

The code and trained models are Apache-2.0, explicitly including one matcher and an open reimplementation of a feature detector. Third-party models that are not compatible, named as the original detector and a classic matcher, are provided in a separate non-free package where each model may follow its own restrictive licence.

How do I install Glue Factory?

Clone the repository and install it in editable mode with pip for the library and its basic dependencies, or install with the optional extras group for advanced features such as the alternative estimators and line detectors. All models and datasets have automatic downloaders, and the benchmarks download their data into a data directory on first run.

What does eval.ransac_th=-1 do in Glue Factory?

It tells the evaluation to auto-tune the RANSAC inlier threshold by running the evaluation across a range of thresholds and reporting results for the optimal value. The same flag is given a positive number on the relative pose benchmark, so the negative value is a sentinel rather than a threshold, and the readme documents it only in the homography section.

Official sources

  1. cvg/glue-factory on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/cvg-glue-factory.svg)](https://hysenlabs.com/projects/cvg-glue-factory)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/cvg-glue-factory.svg)](https://hysenlabs.com/projects/cvg-glue-factory)

Was this useful?