vbalnt / tfeat

TFeat descriptor models for BMVC 2016 paper "Learning local feature descriptors with triplets and shallow convolutional neural networks"
MIT License
148 stars 45 forks source link

Details in tfeat_demo.py #1

Closed mys007 closed 7 years ago

mys007 commented 7 years ago

First of all, thanks for open-sourcing your code. I have two questions/issues regarding tfeat_demo.py:

1) The extracted patches should be normalize to the ranges the network was trained on. In training, I belive one uses [0,1] range and subtracts mean (~0.48) and divides by stddev (~0.18). In testing, opencv works with [0,255] range and L75 just subtracts mean of each patch.

2) ORB may be involuntarily disadvantaged by using improper matching (cv2.NORM_HAMMING is recommended over cv2.NORM_L2, which is useful for tfeat).

vbalnt commented 7 years ago

Hi, thanks for the issue report

for both 1. and 2 you are right, It might affect the demo quite a bit.

@edgarriba any more ideas?

By the way if you have fixes for those two things feel free to send us a PR.

edgarriba commented 7 years ago

@mys007 thanks for your feedback. As @vbalnt said send us a PR with the changes. Besides, probably you will notice some issues with rotated patches. This https://github.com/vbalnt/tfeat/blob/master/tfeat_demo.py#L32 need to be tested since it was not working as expected.

mys007 commented 7 years ago

Thanks for confirmation. Well, I've just hacked it in my version so that it roughly worked (-0.5, no division), I in fact don't know what are the proper normalization values. I suggest you as authors fix it:).

vbalnt commented 7 years ago

There is now code that shows how to do the the mi,sigma norm. For more, please check #5

ducha-aiki commented 7 years ago

@mys007 just in case: mean = 0.443728476019 std = 0.20197947209

mys007 commented 7 years ago

Great!