This repo contains the Pytorch implementation of DDLoc, an adapation of ARC method for absolute coordinate regression.
Please make sure you have access to the CrossLoc Benchmark Raw Datasets and have set it up properly before proceeding.
Also check out other useful repos regarding the datasets:
CrossLoc-Benchmark-Datasets
: CrossLoc benchmark datasets setup tutorial.TOPO-DataGen
: an open and scalable aerial synthetic data generation workflow.
The DDLoc localization algorithm is officially presented in the paper accepted to CVPR 2022
CrossLoc: Scalable Aerial Localization Assisted by Multimodal Synthetic Data
Qi Yan, Jianhao Zheng, Simon Reding, Shanci Li, Iordan Doytchinov
École Polytechnique Fédérale de Lausanne (EPFL)
Links: website | arXiv | code repos | datasets
Happy coding! :)
- Python 3.6 with Ubuntu 16.04
- Pytorch 1.1.0
- dsacstar (if you want to test the camera pose estimation from the scene coordinate prediction)
You also need other third-party libraries, such as numpy, pillow, torchvision, and tensorboardX (optional) to run the code.
We suggest to follow the procedure in CrossLoc repo to install dependecies.
You have to download our provided urbanscape data and place them in the following structure to load the data. See Pretrained Models section for download links.
urban (real)
| train
| rgb
| poses
| init
| calibration
| test
| rgb
| poses
| init
| calibration
urban (synthetic)
| train
| rgb
| poses
| init
| calibration
You can download naturescape data for more experiments and follow the same structure.
- 1 Train Initial Coordinate Regressor C (train_C.py)
- 2 Train Style Translator T (train_T.py)
- 3 Train Initial Attention Module A (train_A.py)
- 4 Train Inpainting Module I (train_U.py)
- 5 Jointly Train Coordinate Regressor C and Attention Module A (train_joint_A_C.py)
- 6 Finetune the Coordinate Regressor C with translated image (train_finetune_C.py)
We provide example scripts for training each step in this folder
batch_size
and eval_batch_size
are flexible to change given your working environment.
Train an initial coordinate regressor C with real and synthetic data. The best model is picked by the one with minimum camera poses error. The checkpoints are saved in ./checkpoints/your_dir_name/train_initial_coord_regressor_C/
.
Train the style translator T with naive mixed data and finetune T by paired real and synthetic data. The best model is picked by visual inspection & training loss curves.
Train an initial attention module A from scratch with descending
Train the inpainting module I with T (from step 2) and A (from step 3).