Coder Social home page Coder Social logo

ctf-vpr's Introduction

The implementation of Coarse-to-Fine Visual Place Recognition, ICONIP 2021.

Abstract

Visual Place Recognition still struggles against viewpoint change, confusion from similar patterns in different places, or high computation complexity. In this paper, we propose a progressive Coarse-To-Fine (CTF-VPR) framework, which has a strong ability on handling irrelevant matches and controlling time consumption. It employs global descriptors to discover visually similar references and local descriptors to filter those with similar but irrelative patterns. Besides, a region-specific representing format called regional descriptor is introduced with region augmentation and increases the possibilities of positive references with partially relevant areas via region refinement. Furthermore, during the spatial verification, we provide the Spatial Deviation Index (SDI) considering coordinate deviation to evaluate the consistency of matches. It discards exhaustive and iterative search and reduces the time consumption hundreds of times.

Codes in PyTorch

The codes are heavily modified from:

  • SFRS: Self-supervising Fine-grained Region Similarities for Large-scale Image Localization, ECCV 2020.
  • Patch-NetVLAD: Multi-Scale Fusion of Locally-Global Descriptors for Place Recognition, CVPR 2021.

For the datasets and pretrained models, please refer to SFRS.

Usage

First, extract and save the image features.

  • For global and regional descriptors, run
python save_feat_region.py --data-dir <your_data_dir> --dataset <pitts_or_tokyo> --resume <pretrained_model_from_SFRS> --save-dir <your_dir_to_save_features>
  • For local descriptors, run
python save_feat_patch.py --data-dir <your_data_dir> --dataset <pitts_or_tokyo> --resume <pretrained_model_from_SFRS> --save-dir <your_dir_to_save_features>

Then, retrieve images from the database (gallery).

  • Global retrieval & Region refinement, run
python pred_region.py --data-dir <your_data_dir> --dataset <pitts_or_tokyo> --load-dir <your_dir_to_save_features> --save-dir <your_dir_to_save_predictions>
  • SDI-based spatial verification, run
python pred_patch.py --data-dir <your_data_dir> --dataset <pitts_or_tokyo> --load-dir <your_dir_to_save_features> --save-dir <your_dir_to_save_predictions>

The results will be the same as those claimed in the paper:

Dataset Recalls (Base) Recalls (RR) Recalls (SV)
Pitts250k 90.7 / 96.4 / 97.6 91.1 / 96.5 / 97.7 92.6 / 97.2 / 97.7
Tokyo24/7 84.1 / 89.2 / 91.3* 87.0 / 92.4 / 93.7 91.1 / 93.7 / 93.7

*: This performance drop (85.4 / 91.1 / 93.3 in SFRS) is caused by smaller query size. Please refer to datasets/__init__.py.

Note that this repo is a simple version neglecting the time cost. For example, we use the argsort function for global retrieval which is highly time-consuming. Using faiss can reduce the retrieval time.

Citation

If you find this code helpful for your research, please cite our paper.

@inproceedings{qi21ctfvpr,
  title = {Coarse-to-Fine Visual Place Recognition},
  author = {Junkun Qi and Rui Wang and Chuan Wang and Xiaochun Cao},
  booktitle = {International Conference on Neural Information Processing (ICONIP)},
  year = {2021}
}

ctf-vpr's People

Contributors

quinnqiao avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.