ubc-vision/COTR

mask

Opened this issue · 3 comments

zbc-l commented

mask = torch.norm(cycle - query, dim=-1) < 10 / constants.MAX_SIZE

why do you use 10 divided by MAX_SIZE?
I can't understand the principle of mask

zbc-l commented

image
Another strange thing is that when I was registering, the queries were located in the white area of the fixed image, but the points found would be in the black area of the moving image.

The mask is used to enforce cycle-consistency loss. We want to enforce cycle-consistency loss only on already close enough correspondences, not catastrophically wrong correspondences. 10/MAX_SIZE is an empirical number for a good measurement of "close enough".
My best guess for the reasons of the drifting in your case is the textureless white and black regions make the correspondences inaccurate.

zbc-l commented

thanks!
I found a magical thing that cycle_loss calculation, after flipping the image and query, the calculated cycle_loss should be the same as before the flip. Because the essence is to calculate the pred of B from picture A, and then calculate the cycle of A from the pred of B, the difference is only in which A and B are on the left, but the truth is that this two cycle_loss are not the same.