-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added HardNet-PS, HardNet-6Br and guide what to use :)
- Loading branch information
1 parent
b606d53
commit 59697ca
Showing
10 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
This version of HardNet is trained on [PS dataset](https://github.com/rmitra/PS-Dataset) by Mitra et.al. with torch package and then converted to PyTorch. | ||
|
||
The structure of the network has minor changes, use this definition: | ||
|
||
class HardNetPS(nn.Module): | ||
def __init__(self): | ||
super(HardNetPS, self).__init__() | ||
self.features = nn.Sequential( | ||
nn.Conv2d(1, 32, kernel_size=3, padding=1, bias = True), | ||
nn.BatchNorm2d(32, affine=True), | ||
nn.ReLU(), | ||
nn.Conv2d(32, 32, kernel_size=3, padding=1, bias = True), | ||
nn.BatchNorm2d(32, affine=True), | ||
nn.ReLU(), | ||
nn.Conv2d(32, 64, kernel_size=3, stride=2, padding=1, bias = True), | ||
nn.BatchNorm2d(64, affine=True), | ||
nn.ReLU(), | ||
nn.Conv2d(64, 64, kernel_size=3, padding=1, bias = True), | ||
nn.BatchNorm2d(64, affine=True), | ||
nn.ReLU(), | ||
nn.Conv2d(64, 128, kernel_size=3, stride=2,padding=1, bias = True), | ||
nn.BatchNorm2d(128, affine=True), | ||
nn.ReLU(), | ||
nn.Conv2d(128, 128, kernel_size=3, padding=1, bias = True), | ||
nn.BatchNorm2d(128, affine=True), | ||
nn.ReLU(), | ||
nn.Conv2d(128, 128, kernel_size=8, bias = True) | ||
) | ||
return | ||
def input_norm(self,x): | ||
flat = x.view(x.size(0), -1) | ||
mp = torch.mean(flat, dim=1) | ||
sp = torch.std(flat, dim=1) + 1e-7 | ||
return (x - mp.unsqueeze(-1).unsqueeze(-1).unsqueeze(-1).expand_as(x)) / sp.unsqueeze(-1).unsqueeze(-1).unsqueeze(1).expand_as(x) | ||
|
||
def forward(self, input): | ||
x_features = self.features(self.input_norm(input)) | ||
x = x_features.view(x_features.size(0), -1) | ||
return L2Norm()(x) | ||
|
||
|
||
If you use this weights, please cite: | ||
|
||
|
||
@ARTICLE{2018arXiv180101466M, | ||
author = {{Mitra}, R. and {Doiphode}, N. and {Gautam}, U. and {Narayan}, S. and | ||
{Ahmed}, S. and {Chandran}, S. and {Jain}, A.}, | ||
title = "{A Large Dataset for Improving Patch Matching}", | ||
journal = {ArXiv e-prints}, | ||
archivePrefix = "arXiv", | ||
eprint = {1801.01466}, | ||
primaryClass = "cs.CV", | ||
keywords = {Computer Science - Computer Vision and Pattern Recognition}, | ||
year = 2018, | ||
month = jan, | ||
adsurl = {http://adsabs.harvard.edu/abs/2018arXiv180101466M}, | ||
adsnote = {Provided by the SAO/NASA Astrophysics Data System} | ||
} |
Binary file not shown.