This is the official repository for the ICCV 2025 paper:
GECO: Geometrically Consistent Embedding with Lightspeed Inference.
Regine Hartwig1,2, Dominik Muhle1,2, Riccardo Marin1,2, Daniel Cremers1,2,
1Technical University of Munich, 2MCML
If you find our work useful, please consider citing our paper:
@inproceedings{hartwig2025geco,
title={GECO: Geometrically Consistent Embedding with Lightspeed Inference},
author={Hartwig, Regine and Muhle, Dominik and Marin, Riccardo and Cremers, Daniel},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision},
year={2025}
}
We address the task of geometry-aware feature encoding. A common way to test geometric awareness is through keypoint matching: Given a source image with an annotated keypoint, the goal is to predict the keypoint in the target image by selecting the location with the highest feature similarity. Below are two examples:
We introduce a training paradigm and a lightweight architecture for learning from image pairs with sparsely annotated keypoints. Additionally, we enhance the testing of features by introducing subdivisions of the commonly used PCK metric and a centroid clustering approach for more densely evaluating the feature space.
If you're using a Linux machine, set up the Python environment with:
conda create --name geco python=3.10
conda activate geco
bash setup_env.shTo use Segment Anything (SAM) for mask extraction:
pip install git+https://github.com/facebookresearch/segment-anything.git
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
Install odise in case you want to run the Geo baseline
git clone [email protected]:NVlabs/ODISE.git
cd ODISE
pip install -e .Run the following scripts to prepare each dataset:
- APK:
Then run the notebook from GeoAware-SC to preprocess the data.
bash download_data/prepare_apk.sh wget https://github.com/Junyi42/GeoAware-SC/blob/master/prepare_ap10k.ipynb
- CUB:
bash download_data/prepare_cub.sh
- PascalParts
bash download_data/prepare_pascalparts.sh
- PFPascal
bash download_data/prepare_pfpascal.sh
- SPair-71k:
bash download_data/prepare_spair.sh
- Define
<your_precomputed_masks_path>in the dataset config files. - Define
<path-model-seg>instore_masks.yamlpointing to the path, wheresam_vit_h_4b8939.pthis stored. - Select the datasets to process in
store_masks.yaml. - Run:
python scripts/store_masks.py --config-name=store_masks.yaml
Choose a path and define <your_precomputed_feats_path> in the dataset config files.
Define which dataset you want to extract the features for in store_feats.yaml and run
python scripts/store_feats.py --config-name=store_feats.yaml Pretrained weights are available in pretrained_weights/geco.
We provide interactive jupyter notebooks for testing.
-
Validate dataset preparation and path setup.
-
Visualize part segmentation using a simple linear classifier.
-
Explore keypoint transfer and interactive attention maps.
Run full evaluation:
python scripts/run_evaluation_all.py --config-name=eval_all.yaml Evaluate inference time and memory usage:
python scripts/run_evaluation_time_mem.py --config-name=eval_time_mem.yaml Evaluate segmentation metrics:
python scripts/run_evaluation_seg.py --config-name=eval_seg.yaml Before training, comment out the following block in configs/featurizer/dinov2lora.yaml:
init:
id: geco
eval_last: TrueThen run:
python scripts/train_pairs.py --config-name=train_pairs.yaml