Home

Awesome

DELG-pytorch

Pytorch Implementation of Unifying Deep Local and Global Features for Image Search (delg-eccv20)

<p align="center"><img width="90%" src="tools/vis/delg_pipline.png" /></p>

Installation

Install Python dependencies:

pip install -r requirements.txt

Set PYTHONPATH:

export PYTHONPATH=`pwd`:$PYTHONPATH

Training

Training a delg model:

python train_delg.py \
    --cfg configs/metric/resnet_delg_8gpu.yaml \
    OUT_DIR ./output \
    PORT 12001 \
    TRAIN.WEIGHTS path/to/pretrainedmodel

Resume training:

python train_delg.py \
    --cfg configs/metric/resnet_delg_8gpu.yaml \
    OUT_DIR ./output \
    PORT 12001 \
    TRAIN.AUTO_RESUME True

Weights

-r50-delg (wu46)

-r101-delg (5pdj)

pretrained weeights are available in pymetric

Feature extraction

!!! Queries should be cropped as DOLG.

Extracting global and local feature for multi-scales

python tools/extractor.py --cfg configs/resnet_delg_8gpu.yaml

Refer extractor.sh for using multicards

See visualize.ipynb for verification of local features

Evaluation on ROxf and RPar

Local Match

<p align="center"><img width="90%" src="tools/vis/matches/match_example_1.jpg" /></p>

Results

See (https://github.com/filipradenovic/revisitop) for details

cd tools/revisitop
python example_evaluate_with_local.py main
BackboneTrain SizeMethodmAP EmAP MmAP H
ResNet50224Global Ranking77.7366.0638.37
ResNet50224Global81.0368.3139.98
ResNet50224Global + Spatial Verification84.8171.9746.63
ResNet50512Global90.5578.5156.90
ResNet50512Global + Spatial Verification90.8680.0858.42
  1. SOTA of R50-DELG is 78.3 mAP@M in the paper, we outperform it
  2. All training set version is GLDv2-clean (81313, 1580470)
  3. Traing size, global and local feature scales adopted are same with the paper