Code and weights for local feature affine shape estimation paper "Repeatability Is Not Enough: Learning Discriminative Affine Regions via Discriminability"
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples Code for video version of Figure 1. Might be useful as boilerplate code Aug 22, 2018
imgs Added illustrations Nov 28, 2017
pretrained ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
test-graf ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
.gitignore ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
HandCraftedModules.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
HardNet++.pth Added simple demo how to use AffNet with descriptor. ORIENTATION PART… Feb 5, 2018
HardNet.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
HardTFeat.pth ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
LAF.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
LICENSE ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
Losses.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
OnePassSIR.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
README.md Update README.md Jul 31, 2018
ReprojectionStuff.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
SparseImgRepresenter.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
Utils.py Initial commit Nov 18, 2017
architectures.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018
augmentation.py switch off geometric loss, as it causes 10x slowdown #10 (comment) Aug 23, 2018
dataset.py couple of fixes Aug 19, 2018
gen_ds.py Initial commit Nov 18, 2017
pytorch_sift.py Initial commit Nov 18, 2017
run_me.sh couple of fixes Aug 19, 2018
train_AffNet_test_on_graffity.py Remove geom dist from log Aug 23, 2018
train_OriNet_test_on_graffity.py ECCV 2018 version, added jupyter notebook to reproduce graphs Jul 15, 2018

README.md

AffNet model implementation

CNN-based affine shape estimator.

AffNet model implementation in PyTorch for ECCV2018 paper "Repeatability Is Not Enough: Learning Discriminative Affine Regions via Discriminability"

AffNet generates up to twice more correspondeces compared to Baumberg iterations HesAff HesAffNet

Retrieval on Oxford5k, mAP

Detector + Descriptor BoW BoW + SV BoW + SV + QE HQE + MA
HesAff + RootSIFT 55.1 63.0 78.4 88.0
HesAff + HardNet++ 60.8 69.6 84.5 88.3
HesAffNet + HardNet++ 68.3 77.8 89.0 89.5

Datasets and Training

To download datasets and start learning affnet:

git clone https://github.com/ducha-aiki/affnet
./run_me.sh

Paper figures reproduction

To reproduce Figure 1 in paper, run notebook

To reproduce Figure 2-3 in paper, run notebooks here

git clone https://github.com/ducha-aiki/affnet
./run_me.sh

Pre-trained models

Pre-trained models can be found in folder pretrained: AffNet.pth

Usage example

We provide two examples, how to estimate affine shape with AffNet. First, on patch-column file, in HPatches format, i.e. grayscale image with w = patchSize and h = nPatches * patchSize

cd examples/just_shape
python detect_affine_shape.py imgs/face.png out.txt

Out file format is upright affine frame a11 0 a21 a22

Second, AffNet inside pytorch implementation of Hessian-Affine

2000 is number of regions to detect.

cd examples/hesaffnet
python hesaffnet.py img/cat.png ells-affnet.txt 2000
python hesaffBaum.py img/cat.png ells-Baumberg.txt 2000

output ells-affnet.txt is Oxford affine format

1.0
128
x y a b c 

WBS example

Example is in [notebook](examples/hesaffnet/WBS demo.ipynb)

Citation

Please cite us if you use this code:

@inproceedings{AffNet2017,
 author = {Dmytro Mishkin, Filip Radenovic, Jiri Matas},
    title = "{Repeatability Is Not Enough: Learning Discriminative Affine Regions via Discriminability}",
    year = 2018,
    month = sep,
    booktitle = {Proceedings of ECCV}
    }