HardNet model implementation in PyTorch for paper "Working hard to know your neighbor's margins: Local descriptor learning loss"
Please use Python 2.7, install OpenCV and additional libraries from requirements.txt
To download datasets and start learning descriptor:
git clone https://github.com/DagnyT/hardnet
./run_me.sh
Logs are stored in tensorboard format in directory logs/
Pre-trained models can be found in folder pretrained: train_liberty and train_liberty_with_aug
We provide an example, how to describe patches with HardNet. Script expects patches in HPatches format, i.e. grayscale image with w = patch_size and h = n_patches * patch_size
cd examples
./extract_hardnet_desc_from_hpatches_file.py imgs/ref.png out.txt
or with Caffe:
cd examples/caffe
python extract_hardnetCaffe_desc_from_hpatches_file.py ../imgs/ref.png hardnet_caffe.txt
Please cite us if you use this code:
@article{HardNet2017,
author = {Anastasiya Mishchuk, Dmytro Mishkin, Filip Radenovic, Jiri Matas},
title = "{Working hard to know your neighbor's margins:Local descriptor learning loss}",
year = 2017}