L4rralde/Visual_Place_Recognition

1

stars

205

commits

Python

primary language

Aug 25, 2026

updated

README

DINO + SALAD for Visual Place Recognition

This repo contains code to train SALAD with DINOv2/DINOv3 backbones. This repo is an evolution of my fork of DINO + SALAD

In addition to the original work "Optimal Transport Aggregation for Visual Place Recognition" I have added the following backbones:

  • DINOv3. Check my results in this link.
  • Visual Geometry Grounded Trasnformer.
  • Not-metric configurations of Depth Anything v3: Small, Base, Large, Giant (with out nesting). I think recent versions of the repo that favor the image orsering scheme for the nested version have broken these versions, so this repo uses a checked out version.
  • MapAnything. Trained with v1.1

Future work may include Efficient Universal Perception Encoder"

Available trained models:

v0.2 Release Notes

All models were retrained using half the number of tokens used at test time. All models improved, but DA3-SALAD Large and MapAnything-SALAD. VGGT-SALAD became the best performing model I'd expect better metrics at test stage (comparing against previous weights). I'll benchmark all models when finished evaluating different configurations. Currently I'm working on VGGT-SALAD++, which will make the unit-tests to fail because of different features are being added. All models were trained for 4 epochs.

Note. I must set all hidden dims to (max) 512. Using larger hiddnen dims increases the probability of easily overfitting.

ModelBackbonePatch SizeEmbedding DimHidden DimPitts30k-val R1Pitts30k-val R5Ckpt size
VGGT-SALADvggt (ViT-L)1410245120.9320.9876.89MB
MapAnything-SALADmapanything (ViT-G)1415365120.9290.9839.88MB
DA3-SALAD Giantda3-giant (ViT-G)14153610240.900.9719.80MB
DA3-SALAD Largeda3-large (ViT-L)1410245120.840.936.89MB
DA3-SALAD Baseda3-base (ViT-B)147685120.880.965.39MB
DA3-SALAD Smallda3-small (ViT-S)143845120.850.943.14MB

Invoking the models:

import torch
model = torch.hub.load(
    'L4rralde/Visual_Place_Recognition',
    <model_name>,
    <path_to_this_repo_clone>
)

Model names: mapanything_salad, vggt_salad, da3_salad_giant, da3_salad_large, da3_salad_base, da3_salad_small.

VGGT probing Release Notes

DINO block 19 was used to produce input tokens for SALAD. Results are shown below:

ModelAdpater depthPitts30k-val R1Pitts30k-val R5Ckpt size
VGGT_L19NA95.2799.126.89MB
VGGT_L19_A295.3999.04104MB
VGGT_L19_ADeep495.9199.20200MB

To use these models:

import torch
model = torch.hub.load(
    'L4rralde/Visual_Place_Recognition',
    <vggt_probed_model_name>,
    <path_to_this_repo_clone>
)

vggt_probed_model_name: vggt_l19_salad, vggt_l19_salad_adapters, vggt_l19_salad_deep_adapters.

My hardware limitations

My trained models haven't even reached the performance of DINOv2+SALAd. Even though I'm using the same training configuration and datasets whilst some of my backbones are even larger. The reason is I'm working with 16GB of VRAM. No attention blocks are trained (DINOv2+SALAD fine tunes 4 ViT Blocks). If possible, I'll migrate to a cloud provider (or borrow a workstation), and add ViT-blocks-like adapters and increase the resolution. The number of tokens used during training must be at least half the number of tokens using at inference.

Note that moving to another computer requires me to install all dependencies, and download and prepare the datasets, so it's not a small task.

Installing

The instructions depend on the backbone you want to use. As April the 20th, Code for DINOv2, DINOv3, VGGT, DepthAnythingv3 and MapAnything as backbones have been developed, yet EUPE is planned.

First, regardless the backbone you want to train, install base requirements in a new python virtual environment (tested on python3.10).

python3.10 -m venv salad.venv
source salad.venv/bin/activate
pip install -r requirements/base.txt

Then, install the specific requirements depending on the backbone, e.g., vggt:

pip install -r requirements/vggt.txt

By the moment I have added requirements for training SALAD with VGGT and DepthAnythingV3

Downloading the Datasets:

For training and validation steps GSVCities and Pitts30k are required

  • GSVCities

You may find it on Kaggle.

  • Pittsburgh 250k

Available on many websites inclusing Kaggle. Make sure pittsburgh dataset tree is correct. For instance, when downloading from kaggle and unzipping, you may find repeated hierarchies such as pittsburgh/000/000 when it should be just pittsburgh/000/. Also, move pittsburgh/netvlad_v100_datasets/datasets/ to pittsburgh/

Training

  1. Set $VPR_GIT_ROOT environment variable:
source set_env_vars.sh
  1. Run the trainer script. $file depends on the backbone you want to use and the configuration. You may find available training configurations in training_configs/ directory
python train_from_yaml.py --config "$file"

TODO:

  • Da3 dino class does not match da3 auxiliar outputs. They do as long we do not preprocess the inputs.
  • Check if tokens' order remain constant. They do. A commit from december 2025 modified the order, but we will use an older version.
  • Latest version of da3 repo breaks some configurations. I think only nested works. Kept one before december.
  • File bug regarding da3, cpu memory and different image aspect ratios
  • Clean up. Remove args that are not required, e.g., return_token. This must be always true.

Contribute

If want to contribute, please send me an email. The current status will be part of my thesis, but further work would be omitted. You can help me to make this models reach (or set) the state of the art. Today, the bottleneck is RAM.

Contributors

L4rralde

205 commits

L4rralde/Visual_Place_Recognition

1

stars

205

commits

Python

primary language

Aug 25, 2026

updated

README

DINO + SALAD for Visual Place Recognition

This repo contains code to train SALAD with DINOv2/DINOv3 backbones. This repo is an evolution of my fork of DINO + SALAD

In addition to the original work "Optimal Transport Aggregation for Visual Place Recognition" I have added the following backbones:

  • DINOv3. Check my results in this link.
  • Visual Geometry Grounded Trasnformer.
  • Not-metric configurations of Depth Anything v3: Small, Base, Large, Giant (with out nesting). I think recent versions of the repo that favor the image orsering scheme for the nested version have broken these versions, so this repo uses a checked out version.
  • MapAnything. Trained with v1.1

Future work may include Efficient Universal Perception Encoder"

Available trained models:

v0.2 Release Notes

All models were retrained using half the number of tokens used at test time. All models improved, but DA3-SALAD Large and MapAnything-SALAD. VGGT-SALAD became the best performing model I'd expect better metrics at test stage (comparing against previous weights). I'll benchmark all models when finished evaluating different configurations. Currently I'm working on VGGT-SALAD++, which will make the unit-tests to fail because of different features are being added. All models were trained for 4 epochs.

Note. I must set all hidden dims to (max) 512. Using larger hiddnen dims increases the probability of easily overfitting.

ModelBackbonePatch SizeEmbedding DimHidden DimPitts30k-val R1Pitts30k-val R5Ckpt size
VGGT-SALADvggt (ViT-L)1410245120.9320.9876.89MB
MapAnything-SALADmapanything (ViT-G)1415365120.9290.9839.88MB
DA3-SALAD Giantda3-giant (ViT-G)14153610240.900.9719.80MB
DA3-SALAD Largeda3-large (ViT-L)1410245120.840.936.89MB
DA3-SALAD Baseda3-base (ViT-B)147685120.880.965.39MB
DA3-SALAD Smallda3-small (ViT-S)143845120.850.943.14MB

Invoking the models:

import torch
model = torch.hub.load(
    'L4rralde/Visual_Place_Recognition',
    <model_name>,
    <path_to_this_repo_clone>
)

Model names: mapanything_salad, vggt_salad, da3_salad_giant, da3_salad_large, da3_salad_base, da3_salad_small.

VGGT probing Release Notes

DINO block 19 was used to produce input tokens for SALAD. Results are shown below:

ModelAdpater depthPitts30k-val R1Pitts30k-val R5Ckpt size
VGGT_L19NA95.2799.126.89MB
VGGT_L19_A295.3999.04104MB
VGGT_L19_ADeep495.9199.20200MB

To use these models:

import torch
model = torch.hub.load(
    'L4rralde/Visual_Place_Recognition',
    <vggt_probed_model_name>,
    <path_to_this_repo_clone>
)

vggt_probed_model_name: vggt_l19_salad, vggt_l19_salad_adapters, vggt_l19_salad_deep_adapters.

My hardware limitations

My trained models haven't even reached the performance of DINOv2+SALAd. Even though I'm using the same training configuration and datasets whilst some of my backbones are even larger. The reason is I'm working with 16GB of VRAM. No attention blocks are trained (DINOv2+SALAD fine tunes 4 ViT Blocks). If possible, I'll migrate to a cloud provider (or borrow a workstation), and add ViT-blocks-like adapters and increase the resolution. The number of tokens used during training must be at least half the number of tokens using at inference.

Note that moving to another computer requires me to install all dependencies, and download and prepare the datasets, so it's not a small task.

Installing

The instructions depend on the backbone you want to use. As April the 20th, Code for DINOv2, DINOv3, VGGT, DepthAnythingv3 and MapAnything as backbones have been developed, yet EUPE is planned.

First, regardless the backbone you want to train, install base requirements in a new python virtual environment (tested on python3.10).

python3.10 -m venv salad.venv
source salad.venv/bin/activate
pip install -r requirements/base.txt

Then, install the specific requirements depending on the backbone, e.g., vggt:

pip install -r requirements/vggt.txt

By the moment I have added requirements for training SALAD with VGGT and DepthAnythingV3

Downloading the Datasets:

For training and validation steps GSVCities and Pitts30k are required

  • GSVCities

You may find it on Kaggle.

  • Pittsburgh 250k

Available on many websites inclusing Kaggle. Make sure pittsburgh dataset tree is correct. For instance, when downloading from kaggle and unzipping, you may find repeated hierarchies such as pittsburgh/000/000 when it should be just pittsburgh/000/. Also, move pittsburgh/netvlad_v100_datasets/datasets/ to pittsburgh/

Training

  1. Set $VPR_GIT_ROOT environment variable:
source set_env_vars.sh
  1. Run the trainer script. $file depends on the backbone you want to use and the configuration. You may find available training configurations in training_configs/ directory
python train_from_yaml.py --config "$file"

TODO:

  • Da3 dino class does not match da3 auxiliar outputs. They do as long we do not preprocess the inputs.
  • Check if tokens' order remain constant. They do. A commit from december 2025 modified the order, but we will use an older version.
  • Latest version of da3 repo breaks some configurations. I think only nested works. Kept one before december.
  • File bug regarding da3, cpu memory and different image aspect ratios
  • Clean up. Remove args that are not required, e.g., return_token. This must be always true.

Contribute

If want to contribute, please send me an email. The current status will be part of my thesis, but further work would be omitted. You can help me to make this models reach (or set) the state of the art. Today, the bottleneck is RAM.

Contributors

L4rralde

205 commits

Languages

Python

98.5%