Configuration

Glue Factory uses OmegaConf for configuration management. Configurations are typically stored in YAML files in gluefactory/configs/.

Config Structure

A standard experiment configuration consists of three main sections:

  1. data: Defines the dataset, preprocessing, and loader settings.
  2. model: Defines the pipeline architecture (extractor, matcher, etc.).
  3. train (or eval): Defines training hyperparameters or evaluation settings.

Example Configuration

Here is an example for superpoint+lightglue_homography.yaml:

data:
    name: homographies
    data_dir: revisitop1m
    batch_size: 128
    homography:
        difficulty: 0.7
        max_angle: 45

model:
    name: two_view_pipeline
    extractor:
        name: gluefactory_nonfree.superpoint
        max_num_keypoints: 512
        trainable: False
    matcher:
        name: matchers.lightglue
        input_dim: 256

train:
    epochs: 40
    lr: 1e-4

Overriding Configuration

You can override any config value from the command line. Nested keys are accessed via dot notation.

Examples:

  • Change learning rate: train.lr=1e-5
  • Change batch size: data.batch_size=64
  • Disable flash attention: model.matcher.flash=false

Benchmark-Specific Configs

When running evaluations, you can define benchmark-specific overrides inside the config file:

benchmarks:
    hpatches:
        eval:
            estimator: opencv
            ransac_th: 0.5
    megadepth1500:
        data:
            preprocessing:
                resize: 1600

When running python -m gluefactory.eval.hpatches, the configuration under benchmarks.hpatches will be merged into the main config.