Skip to content

ais-lab/A-SCoRe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A-SCoRe

This repo contains code associated with the A-SCoRe paper

Installation

To use pnp ransac, you need to build the cython module:

cd ./pnpransac/
python setup.py build_ext --inplace

Then create the conda environment using the .yml config file:

conda env create -f environment.yml
conda activate ascore

Dataset

7-Scenes

Download the dataset from the project page

mkdir datasets/7scenes
export dataset=datasets/7scenes
for scene in chess fire heads office pumpkin redkitchen stairs; \
do wget http://download.microsoft.com/download/2/8/5/28564B23-0828-408F-8631-23B1EFF1DAC8/$scene.zip -P $dataset \
&& unzip $dataset/$scene.zip -d $dataset && unzip $dataset/$scene/'*.zip' -d $dataset/$scene; done

We also provide the SfM models running SuperPoint configuration in this location

12-Scenes

mkdir datasets/12scenes
export dataset=datasets/12scenes
for scene in apt1 apt2 office1 office2; \
  do wget https://graphics.stanford.edu/projects/reloc/data/$scene.zip -P $dataset \
    && unzip $dataset/$scene.zip -d $dataset;
  done

Cambridge

mkdir datasets/Cambridge
export scenes=( "KingsCollege" "OldHospital" "StMarysChurch" "ShopFacade" "GreatCourt" )
export IDs=( "251342" "251340" "251294" "251336" "251291" )
for i in "${!scenes[@]}"; do
wget https://www.repository.cam.ac.uk/bitstream/handle/1810/${IDs[i]}/${scenes[i]}.zip -P $dataset \
&& unzip $dataset/${scenes[i]}.zip -d $dataset && rm $dataset/${scenes[i]}.zip; done

Custom

Coming

Usage

Training and validation (dense setting)

Training command:

python lightning/main.py --model sp_sg_attn \
                          --dataset 7Scenes \ 
                          --scene chess \
                          --device 0 \
                          --mode train \
                          --n_iter 300000 \
                          --batch_size 8 \
                          --num_workers 4 \
                          --aug True \
                          --data_path /path/to/metadata \ 
                          --img_path /path/to/image \
                          

Evaluating command:

python lightning/main.py --model sp_sg_attn \ 
                          --dataset 7Scenes \
                          --scene chess \
                          --mode test \
                          --device 0 \
                          --n_iter 300000 \ 
                          --batch_size 8 \ 
                          --num_workers 4 \
                          --aug True \
                          --data_path /path/to/metadata \ 
                          --img_path /path/to/image \ 
                          --pretrained_ckpt /path/to/pretrained/model \
                          --validate_on_train False \

Training and validation (sparse setting)

Training command

python lightning/main.py --model sp_sg_attn \
                          --dataset 7Scenes_SfM \ 
                          --loss regcoord_loss \
                          --scene chess \
                          --device 0 \
                          --mode train \
                          --n_iter 300000 \
                          --batch_size 8 \
                          --num_workers 4 \
                          --aug True \
                          --data_path /path/to/metadata \ 
                          --img_path /path/to/image \

Evaluating command

python lightning/main.py --model sp_sg_attn \
                          --dataset 7Scenes_SfM \ 
                          --loss regcoord_loss \
                          --scene chess \
                          --mode test \
                          --device 0 \
                          --mode train \
                          --n_iter 300000 \
                          --batch_size 8 \
                          --num_workers 4 \
                          --aug True \
                          --data_path /path/to/metadata \ 
                          --img_path /path/to/image \

Pretrained models

Publication

If you find any part of this code useful, please cite:


Acknowledgement

Thanks to authors of these great opensource projects: Hloc, HSCNet, D2S for their contributions that we take inspiration from.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published