Thanks to visit codestin.com
Credit goes to github.com

Skip to content

reginehartwig/geco

Repository files navigation

🦎 GECO: Geometrically Consistent Embedding with Lightspeed Inference (ICCV 2025)

🌐Project Page📄 Paper

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

ICCV 2025 (arXiv)

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}
}

Intro

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.

🔧 Environment Setup

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

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

🚀 Get Started

📁 Prepare the Datasets

Run the following scripts to prepare each dataset:

  • APK:
    bash download_data/prepare_apk.sh
    wget https://github.com/Junyi42/GeoAware-SC/blob/master/prepare_ap10k.ipynb
    Then run the notebook from GeoAware-SC to preprocess the data.
  • 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

Extract the mask

  1. Define <your_precomputed_masks_path> in the dataset config files.
  2. Define <path-model-seg> in store_masks.yaml pointing to the path, where sam_vit_h_4b8939.pthis stored.
  3. Select the datasets to process in store_masks.yaml.
  4. Run:
     python scripts/store_masks.py --config-name=store_masks.yaml 

Precompute the features (not recommended)

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

Pretrained weights are available in pretrained_weights/geco.

🧪 Interactive Demos: Give it a Try!

We provide interactive jupyter notebooks for testing.

📊 Run Evaluation

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 

🏋️ Train the Model

Before training, comment out the following block in configs/featurizer/dinov2lora.yaml:

init:
  id: geco
  eval_last: True

Then run:

python scripts/train_pairs.py --config-name=train_pairs.yaml 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published