Views
No views yet


1git clone --recursive https://github.com/ffrivera0/reloc3r.git
2cd reloc3r
3# if you have already cloned reloc3r:
4# git submodule update --init --recursive1conda create -n reloc3r python=3.11 cmake=3.14.0
2conda activate reloc3r
3conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia # use the correct version of cuda for your system
4pip install -r requirements.txt
5# optional: you can also install additional packages to:
6# - add support for HEIC images
7pip install -r requirements_optional.txt1# Reloc3r relies on RoPE positional embeddings for which you can compile some cuda kernels for faster runtime.
2cd croco/models/curope/
3python setup.py build_ext --inplace
4cd ../../../wild_relpose.py. We provide some image pairs used in our paper.1# replace the args with your paths
2python wild_relpose.py --v1_path ./data/wild_images/zurich0.jpg --v2_path ./data/wild_images/zurich1.jpg --output_folder ./data/wild_images/1# replace the args with your paths
2python visualization.py --mode relpose --pose_path ./data/wild_images/pose2to1.txtwild_visloc.py estimates absolute camera poses from sampled frames in self-captured videos.[!IMPORTANT] The demo simply uses the first and last frames as the database, which requires overlapping regions among all images. This demo does not support linear motion. We provide some videos as examples.
1# replace the args with your paths
2python wild_visloc.py --video_path ./data/wild_video/ids.MOV --output_folder ./data/wild_video1# replace the args with your paths
2python visualization.py --mode visloc --pose_folder ./data/wild_video/ids_poses/./data/.
Then run the following script. You will obtain results similar to those presented in our paper.bash scripts/eval_relpose.sh[!NOTE] To achieve faster inference speed, set--amp=1. This enables evaluation withfp16, which increases speed from 24 FPS to 40 FPS on an RTX 4090 with Reloc3r-512, without any accuracy loss.
./data/cambridge/.
Then run the following script. You will obtain results similar to those presented in our paper.bash scripts/eval_visloc.shdatasets_preprocess directory and an archive containing the list of pairs when needed. You have to download the datasets yourself from their official sources, agree to their license, and run the preprocessing script.bash scripts/train_small.shbash scripts/train.sh[!NOTE] They are not strictly equivalent to what was used to train Reloc3r, but they should be close enough.
@article{reloc3r,
title={Reloc3r: Large-Scale Training of Relative Camera Pose Regression for Generalizable, Fast, and Accurate Visual Localization},
author={Dong, Siyan and Wang, Shuzhe and Liu, Shaohui and Cai, Lulu and Fan, Qingnan and Kannala, Juho and Yang, Yanchao},
journal={arXiv preprint arXiv:2412.08376},
year={2024}
}