Skip to content

Commit

Permalink
New weights and hyperparameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ducha-aiki committed Jan 11, 2018
1 parent 98e55b3 commit b606d53
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
HardNet model implementation in PyTorch for NIPS 2017 paper ["Working hard to know your neighbor's margins: Local descriptor learning loss"](https://arxiv.org/abs/1705.10872)
[poster](http://cmp.felk.cvut.cz/~mishkdmy/posters/hardnet2017.pdf), [slides](http://cmp.felk.cvut.cz/~mishkdmy/slides/HardNet2017.pdf)

## Important update
After two major updates of PyTorch library, we were not able to reproduce the results. Therefore, we did a hyperparameter search and we found that increasing the learning rate to 10 and dropout rate to 0.3 leads to better results, see figure below. We have obtained the same results on different machines
. We will update arXiv version soon.
Pretrained weights in PyTorch format are update.

We also are planning to release better version of HardNet, trained on several datasets, stay tuned :)

## Benchmark on [HPatches](https://github.com/hpatches/hpatches-benchmark), mAP
![HPatches-results](img/hardnet-hpatches.jpg)
![HPatches-results](img/hpatches_results.png)


## Retrieval on Oxford5k, mAP
Expand Down
6 changes: 3 additions & 3 deletions code/HardNetMultipleDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def forward(self, input):
parser.add_argument('--dataroot', type=str,
default='../datasets/',
help='path to dataset')
parser.add_argument('--enable-logging', type=str2bool, default=True,
parser.add_argument('--enable-logging', type=str2bool, default=False,
help='output to tensorlogger')
parser.add_argument('--log-dir', default='../logs/',
help='folder to output log')
Expand Down Expand Up @@ -100,9 +100,9 @@ def forward(self, input):
help='number of epochs to train (default: 10)')
parser.add_argument('--anchorswap', type=bool, default=True,
help='turns on anchor swap')
parser.add_argument('--batch-size', type=int, default=128, metavar='BS',
parser.add_argument('--batch-size', type=int, default=1024, metavar='BS',
help='input batch size for training (default: 1024)')
parser.add_argument('--test-batch-size', type=int, default=128, metavar='BST',
parser.add_argument('--test-batch-size', type=int, default=1024, metavar='BST',
help='input batch size for testing (default: 1024)')
parser.add_argument('--n-triplets', type=int, default=1000, metavar='N',
help='how many triplets will generate from the dataset')
Expand Down
Binary file removed examples/caffe/checkpoint_liberty_no_aug.caffemodel
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions examples/caffe/convert_weights_to_caffe.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def copy_weights(m,):
"../../pretrained/train_notredame/checkpoint_notredame_no_aug.pth",
"../../pretrained/train_yosemite_with_aug/checkpoint_yosemite_with_aug.pth",
"../../pretrained/pretrained_all_datasets/HardNet++.pth"
"../../pretrained/pretrained_all_datasets/HardNetFullBrown.pth"
]

for model_weights in mws:
Expand Down
Binary file added img/hpatches_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pretrained/train_liberty/checkpoint_liberty_no_aug.pth
Binary file not shown.
Binary file modified pretrained/train_liberty_with_aug/checkpoint_liberty_with_aug.pth
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit b606d53

Please sign in to comment.