Dual-Resolution Correspondence Network
Dual-Resolution Correspondence Network, NeurIPS 2020
Dependency
All dependencies are included in asset/dualrcnet.yml
. You need to install conda first, and then run
conda env create --file asset/dualrcnet.yml
To activate the environment, run
conda activate dualrcnet
Preparing data
We train our model on MegaDepth dataset. To prepare for the data, you need to download the MegaDepth SfM models from the MegaDepth website and download training_pairs.txt
and validation_pairs.txt
from this link. Then place both training_pairs.txt
and validation_pairs.txt
files under the downloaded directory MegaDepth_v1_SfM
.
Training
After downloading the training data, run
python train.py --training_file path/to/training_pairs.txt --validation_file path/to/validation_pairs.txt --image_path path/to/MegaDepth_v1_SfM
Pre-trained model
We also provide our pre-trained model. You can download dualrc-net.pth.tar
from this link and place it under the directory trained_models
.
Evaluation on HPatches
The dataset can be downloaded from HPatches repo. You need to download HPatches full sequences.
After downloading the dataset, then:
- Browse to
HPatches/
- Run
python eval_hpatches.py --checkpoint path/to/model --root path/to/parent/directory/of/hpatches_sequences
. This will generate a text file which stores the result in current directory. - Open
draw_graph.py
. Change relevent path accordingly and run the script to draw the result.
We provide results of DualRC-Net alongside with results of other methods in directory cache-top
.
Evaluation on InLoc
In order to run the InLoc evaluation, you first need to clone the InLoc demo repo, and download and compile all the required depedencies. Then:
- Browse to
inloc/
. - Run
python eval_inloc_extract.py
adjusting the checkpoint and experiment name. This will generate a series of matches files in theinloc/matches/
directory that then need to be fed to the InLoc evaluation Matlab code. - Modify the
inloc/eval_inloc_compute_poses.m
file provided to indicate the path of the InLoc demo repo, and the name of the experiment (the particular directory name insideinloc/matches/
), and run it using Matlab. - Use the
inloc/eval_inloc_generate_plot.m
file to plot the results from shortlist file generated in the previous stage:/your_path_to/InLoc_demo_old/experiment_name/shortlist_densePV.mat
. Precomputed shortlist files are provided ininloc/shortlist
.
Evaluation on Aachen Day-Night
In order to run the Aachen Day-Night evaluation, you first need to clone the Visualization benchmark repo, and download and compile all the required depedencies (note that you'll need to compile Colmap if you have not done so yet). Then:
- Browse to
aachen_day_and_night/
. - Run
python eval_aachen_extract.py
adjusting the checkpoint and experiment name. - Copy the
eval_aachen_reconstruct.py
file tovisuallocalizationbenchmark/local_feature_evaluation
and run it in the following way:
python eval_aachen_reconstruct.py
--dataset_path /path_to_aachen/aachen
--colmap_path /local/colmap/build/src/exe
--method_name experiment_name
- Upload the file
/path_to_aachen/aachen/Aachen_eval_[experiment_name].txt
tohttps://www.visuallocalization.net/
to get the results on this benchmark.
BibTex
If you use this code, please cite our paper
@inproceedings{li20dualrc,
author = {Xinghui Li and Kai Han and Shuda Li and Victor Prisacariu},
title = {Dual-Resolution Correspondence Networks},
booktitle = {Conference on Neural Information Processing Systems (NeurIPS)},
year = {2020},
}
Acknowledgement
Our code is based on the wonderful code provided by NCNet, Sparse-NCNet and ANC-Net.