TRI-ML / KP2D

MIT License
177 stars 35 forks source link

About the code #7

Closed wangch-g closed 3 years ago

wangch-g commented 4 years ago

Thanks for your work. I have a question about the code. In file "augmentation.py", the source image is the original input image, and the target image (image_aug) is warpped from source image using H matrix. But, in file "KeypointNetwithIOLoss.py", the augmented image (image_aug) is used as the source image, why? I am really confused by this, could you help me with this question? Thanks a lot!

RaresAmbrus commented 3 years ago

Hi, thanks for the question! Technically we can use the term source and target interchangeably, as they are both passed through the keypoint net here. What's important is that we use the correct homography here. In our case, because of the way we construct the target image in augmentation.py by using the grid sampling operation, the homography warps target pixels into the source image, and we use it correctly in the KeypointNetWithIOLoss.

But you're right that the terminology is confusing, we should be consistent with how we use source and target everywhere in the code, I'll make a note to fix that. I hope that helps and thanks for spotting this!

wangch-g commented 3 years ago

Thank you very much!

RaresAmbrus commented 3 years ago

We just merged a PR with the cleanup - hopefully it makes more sense now!