verlab / accelerated_features

Implementation of XFeat (CVPR 2024). Do you need robust and fast local feature extraction? You are in the right place!
https://www.verlab.dcc.ufmg.br/descriptors/xfeat_cvpr24
Apache License 2.0
973 stars 102 forks source link

acc_f nan #44

Closed Xiaole-An closed 2 months ago

Xiaole-An commented 3 months ago

Hello, I am using the description in the README to reproduce your code.

During this process, I encountered some issues. I don't know why the acc_f is showing up as nan. I made some changes to the code and I'm not sure if these changes are related to the acc_f being nan.

I made the following changes:

  1. On line 161 of 'augumentation.py', I changed im = np.rot90(im) to im = cv2.rotate(im, cv2.ROTATE_90_CLOCKWISE) to avoid errors during training.
  2. In utils.py, line 36, I changed data = np.array(h5py.File(f, 'r')['/depth']) to data = np.array(h5py.File(f, 'r')['/depth'], dtype=np.float32) to avoid errors during training.

Besides the changes mentioned, I did not modify anything else, but acc_f still shows nan. Could you explain why this might be happening?

Xiaole-An commented 3 months ago

Hmm, after training for around 1000 iterations, acc_f is no longer nan. Has the author encountered this situation before, and what do you think about this behavior?

guipotje commented 2 months ago

Hello @Xiaole-An, this is expected at the beginning since the accuracy starts at zero due to random guessing. After a few iterations, the network begins to correctly estimate some offsets. The initial NaN values occur because the accuracy calculation results in NaN when there are no correct predictions.

Xiaole-An commented 2 months ago

@guipotje thanks. Thank you for your response. I will continue to study and implement your code. The method you proposed looks quite effective. If I encounter any further issues, I will reach out to you. Thank you for your contribution.

guipotje commented 2 months ago

Thank you! Feel free to open other issue if you encounter another issue.