Giter Club home page Giter Club logo

mirror's Introduction

MIRorR: Matchable Image Retrieval by Learning from Surface Reconstruction

Mirror is the matchable image retrieval pipeline for 3D reconstruction and related applications. Different from typical object retrieval, matchable image retrieval aims to find similar images with large overlaps. Typical CNN-based methods do not generalize well to this problem because models are trained to find objects of the same category. This project proposes a new method to tackle this problem, by utilizing regional feature aggregation and the accurate auto-annotated 3D geometric data. For more details, you can refer to the paper:

Matchable Image Retrieval by Learning from Surface Reconstruction

Tianwei Shen*, Zixin Luo*, Lei Zhou, Runze Zhang, Siyu Zhu, Tian Fang, Long Quan (* denotes equal contributions)

In ACCV 2018.

Feel free to submit issues if you have any questions.

Prerequisites

The code base has been tested under TensorFlow 1.5 (CUDA 8.0) to TensorFlow (CUDA 9.0), using Python 2.7.12.

GL3D dataset

GL3D overview

The GL3D contains 90,590 high-resolution images in 378 different scenes. Each scene contains 50 to 1,000 images with large geometric overlaps, covering urban, rural area, or scenic spots captured by drones from multiple scales and perspectives. Several small objects are also included to enrich the data diversity. Each scene data is reconstructed to generate a triangular mesh model by the state-of-the-art 3D reconstruction pipeline.

Currently we release the 9368 test images for evaluation (see #Test). The full dataset is in preparation.

Train

Training code will be released soon.

Test

First download the model files using the following command, suppose you are in the root directory of the project $MIRROR_ROOT

sh ./data/model/download_models.sh

Please refer to pipeline.sh for using the image retrieval pipeline. We release two trained models to demonstrate the use. The googlenet model can be used to reproduce the results in the paper, which achieves 0.758 mAP@200 on GL3D, 0.768 mAP on Oxford5K and 0.820 on Paris6K using the default settings in pipeline.sh.

We have additionally trained a ResNet-50 model not documented in the original paper, which achieves better performance than GoogleNet on object retrieval datasets (Oxford5K and Paris6K).

Model GL3D (mAP@200) Oxford5K Paris6K Holidays
GoogleNet 0.758 0.768 0.820 0.861
ResNet-50 0.745 0.833 0.805 0.892
ResNet-50 + QE - 0.894 0.858 0.881

Note on GL3D

Download the GL3D test images of size 896 x 896 (around 3.7GB) and unzip them to your GL3D image folder (suppose it is $MIRROR_ROOT/data/gl3d/), and then run the commands for testing. The detailed instruction is given below.

# Download evaluation dataset and unzip
wget https://s3-ap-southeast-1.amazonaws.com/awsiostest-deployments-mobilehub-806196172/GL3D/eval_data.zip
mv eval_data.zip ./data/gl3d/
cd data/gl3d/
unzip eval_data.zip
cd -
# Set up testing configs
net_type=resnet-50 #googlenet
pooling=MAX
step=720000 #400000 
ckpt_save_dir=./data/model/model.ckpt 
img_size=896
feature_dim=256
gl3d_root_dir=$MIRROR_ROOT/data/gl3d/
test_image_list=./data/gl3d/eval_img_list.txt
test_feature_list=./data/gl3d/eval_feature_list.txt
rmac_step=1,3,5
output_dir=./output
# Extract features
python retrieval/inference.py --img_list $test_image_list --ckpt_step $step --img_size $img_size \
    --net $net_type --pool $pooling --rmac_step $rmac_step --ckpt_path $ckpt_save_dir --gl3d_root $gl3d_root_dir
# PR-MAC + Top-k
python retrieval/deep_query.py --feature_list $test_feature_list --out_dir $output_dir --top 200 --out_dim $feature_dim --dataset_root $gl3d_root_dir
# Compute statistics
python retrieval/compute_overlap_benchmark.py $test_image_list $output_dir/match_pairs data/gl3d/gl3d_gt_pairs

Note on Oxford5K or Paris6K

To run the model on Oxford5K or Paris6K, there is one additional step. Suppose you are in the root directory of this repo, you need to first compile the C++ program compute_ap for computing the average precision (AP).

cd cpp
g++ -o compute_ap compute_ap.cpp

Note on Holidays

Downloads INRIA Holidays dataset at official website, prepare the required input lists and use the commands in pipeline.sh to reproduce the results.

Related Projects

Also checkout the following related geometric learning repositories:

GeoDesc: Learning Local Descriptors by Integrating Geometry Constraints

MVSNet: Depth Inference for Unstructured Multi-view Stereo

License

MIT

mirror's People

Contributors

hlzz avatar lzx551402 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar paper2code - bot 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.