TRI-ML / KP2D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the code

wangch-g opened this issue · comments

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!

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!

Thank you very much!

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