Skip to content

Repository files navigation

[ICLR'26] Loc2: Interpretable Cross-View Localization via Depth-Lifted Local Feature Matching

[Arxiv][BibTeX]

📝 Abstract

We propose an accurate and interpretable fine-grained cross-view localization method that estimates the 3 Degrees of Freedom (DoF) pose of a ground-level image by matching its local features with a reference aerial image. Unlike prior approaches that rely on global descriptors or bird's-eye-view (BEV) transformations, our method directly learns ground-aerial image-plane correspondences using weak supervision from camera poses. The matched ground points are lifted into BEV space with monocular depth predictions, and scale-aware Procrustes alignment is then applied to estimate camera rotation, translation, and optionally the scale between relative depth and the aerial metric space. This formulation is lightweight, end-to-end trainable, and requires no pixel-level annotations. Experiments show state-of-the-art accuracy in challenging scenarios such as cross-area testing and unknown orientation. Furthermore, our method offers strong interpretability: correspondence quality directly reflects localization accuracy and enables outlier rejection via RANSAC, while overlaying the re-scaled ground layout on the aerial image provides an intuitive visual cue of localization performance.

📦 Checkpoints

📁 Download pretrained models

🛠️ Installation

git clone --recursive git@github.com:vita-epfl/Loc2.git
cd Loc2 & bash install.sh

Note: The codebase is tested with PyTorch 2.3.1, CUDA 11.8, and xFormers 0.0.27 on NVIDIA A100/H100 GPUs. The experiments reported in the paper were conducted using PyTorch 2.2.2, CUDA 12.1, and xFormers 0.0.25.

🗂️ Datasets and Depth Maps Preparation

VIGOR

Please download and prepare the VIGOR dataset by following the instructions in the official repository.

To generate metric depth maps for the VIGOR dataset (for both training and evaluation):

pip install -e external/unik3d/ # Install UniK3D dependency
python preprocess/infer_depth_vigor.py --input <VIGOR_PATH>/<CITY_NAME>/panorama --output <VIGOR_PATH>/<CITY_NAME>/unik3d_depth --save

KITTI

Please download and organize the KITTI dataset according to the directory structure used in HighlyAccurate.

To generate metric depth maps for the KITTI dataset (for both training and evaluation):

python preprocess/infer_depth_kitti.py --img-path <KITTI_PATH> --outdir <OUTPUT_DIR> --save-depth

Note: Please download the corresponding checkpoint from here and place it under external/depthanythingv2/metric_depth/checkpoints.

📊 Evaluation

Run all commands from the repository root.

VIGOR

python eval_vigor.py --area <samearea|crossarea> --random_orientation <0|180> --ransac True --model_path <checkpoint>

Checkpoints:

  • checkpoints/vigor/samearea/known_ori/model.pt
  • checkpoints/vigor/samearea/unknown_ori/model.pt
  • checkpoints/vigor/crossarea/known_ori/model.pt
  • checkpoints/vigor/crossarea/unknown_ori/model.pt

KITTI

python eval_kitti.py --rotation_range <10|180> --max_depth 40 --model_path <checkpoint>

Checkpoints:

  • checkpoints/kitti/ori_noise10/model.pt
  • checkpoints/kitti/ori_noise180/model.pt

Output

Evaluation results are saved to results/ by default. Use --results_dir /path/to/output_dir to override it.

🖼️ Visualization

Generate qualitative VIGOR matching and depth-lifted overlay figures:

python visualize_vigor.py --area samearea --random_orientation 180 --model_path <checkpoint> --index 0 1 2

Figures are saved to figures/ by default. Use --output_dir /path/to/figures to override it.

🚀 Training

VIGOR

python train_vigor.py --area <samearea|crossarea> --random_orientation <0|180>

Optional arguments:

  • --batch_size (default: 80)
  • --learning_rate (default: 1e-4)
  • --max_depth (default: 35)
  • --beta (default: 1.0)
  • --loss_grid_size (default: 5.0)
  • --temperature (default: 0.1)
  • --epoch_to_resume to resume training

Training checkpoints are saved to ../checkpoints/ and metrics are saved to ../results/.

KITTI

python train_kitti.py --rotation_range <10|180>

Optional arguments:

  • --batch_size (default: 128)
  • --learning_rate (default: 1e-4)
  • --max_depth (default: 40)
  • --beta (default: 0.1)
  • --loss_grid_size (default: 5.0)
  • --temperature (default: 0.1)
  • --epoch_to_resume to resume training

Training checkpoints are saved to ../checkpoints/ and metrics are saved to ../results/.

✅ To-Do

  • Initial repo structure
  • Evaluation pipeline
  • Pretrained checkpoints
  • Training scripts
  • Visualization tools

Citation

@inproceedings{xia2026loc,
  title={{Loc}$^2$: Interpretable Cross-View Localization via Depth-Lifted Local Feature Matching},
  author={Xia, Zimin and Xu, Chenghao and Alahi, Alexandre},
  booktitle={The Fourteenth International Conference on Learning Representations},
  year={2026}
}

About

[ICLR'26] Loc2: Interpretable Cross-View Localization via Depth-Lifted Local Feature Matching

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages