MCPcopy Index your code
hub / github.com/Lu-Feng/DHE-VPR

github.com/Lu-Feng/DHE-VPR @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
156 symbols 389 edges 20 files 27 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DHE-VPR

This is the official repository for the AAAI 2024 paper "Deep Homography Estimation for Visual Place Recognition". [AAAI proceedings] [arXiv] The arXiv version is more complete.

Our another two-stage VPR work SelaVPR achieved SOTA performance on several datasets. The code has been released HERE.

Getting Started

This repo follows the Visual Geo-localization Benchmark. You can refer to it (VPR-datasets-downloader) to prepare datasets and train the CCT-14 backbone (i.e. feature extractor).

The dataset should be organized in a directory tree as such:

├── datasets_vg
    └── datasets
        └── pitts30k
            └── images
                ├── train
                │   ├── database
                │   └── queries
                ├── val
                │   ├── database
                │   └── queries
                └── test
                    ├── database
                    └── queries

You can directly download the trained CCT-14 backbone:

trained on MSLS: CCT14_msls

trained on Pitts30k: CCT14_pitts30k

Train (initialize) the DHE network

After getting the CCT14 backbone trained on MSLS (CCT14_msls.pth), you can train (i.e. initialize) the DHE network on MSLS:

python train_dhe.py --resume_fe=/path/to/your/CCT14_msls.pth --datasets_folder=/path/to/your/datasets_vg/datasets --dataset_name=msls

You can directly download the initialized DHE network HERE.

Finetune

To jointly finetune the backbone and the DHE network on the MSLS dataset, please run:

python3 finetune.py --datasets_folder=/path/to/your/datasets_vg/datasets --dataset_name=msls --epochs_num=2 --resume_fe=/path/to/your/CCT14_msls.pth --resume_hr=/path/to/your/initializedDHE.torch --queries_per_epoch=10000

Finetune on the Pitts30k dataset, please run:

python3 finetune.py --datasets_folder=/path/to/your/datasets_vg/datasets --dataset_name=pitts30k --epochs_num=40 --resume_fe=/path/to/your/CCT14_pitts30k.pth --resume_hr=/path/to/your/initializedDHE.torch

You can directly download the finetuned CCT14 backbone and DHE network:

MSLS: finetunedCCT14 | finetunedDHE

Pitts30k: finetunedCCT14 | finetunedDHE

Test

To evaluate the finetuned complete DHE-VPR model on MSLS (or Pitts30k), run:

python eval.py  --resume_fe=/path/to/your/finetunedCCT14_msls.torch --resume_hr=/path/to/your/finetunedDHE_msls.torch --datasets_folder=/path/to/your/datasets_vg/datasets --dataset_name=msls

Acknowledgements

Parts of this repo are inspired by the following repositories:

Visual Geo-localization Benchmark

GeoWarp

TransVPR

Citation

If you find this repo useful for your research, please consider citing the paper

@inproceedings{dhevpr,
  title={Deep Homography Estimation for Visual Place Recognition},
  author={Lu, Feng and Dong, Shuting and Zhang, Lijun and Liu, Bingxi and Lan, Xiangyuan and Jiang, Dongmei and Yuan, Chun},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  year={2024},
  volume={38}, 
  number={9}, 
  pages={10341-10349}
}

Core symbols most depended-on inside this repo

cct_7
called by 8
model/cct/cct.py
path_to_pil_img
called by 5
datasets_ws.py
_cct
called by 5
model/cct/cct.py
cct_6
called by 4
model/cct/cct.py
get_positives
called by 3
datasets_ws.py
cct_14
called by 3
model/cct/cct.py
similarity
called by 2
network.py
regression
called by 2
network.py

Shape

Method 84
Function 47
Class 25

Languages

Python100%

Modules by API surface

datasets_ws.py32 symbols
model/cct/cct.py28 symbols
network.py23 symbols
model/cct/transformers.py22 symbols
model/cct/tokenizer.py11 symbols
commons.py8 symbols
dataset_geoloc.py6 symbols
model/cct/embedder.py5 symbols
model/cct/stochastic_depth.py4 symbols
homography_project.py4 symbols
dataset_qp.py4 symbols
util.py2 symbols

For agents

$ claude mcp add DHE-VPR \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact