Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mask #43

Open
zbc-l opened this issue Feb 17, 2023 · 3 comments
Open

mask #43

zbc-l opened this issue Feb 17, 2023 · 3 comments

Comments

@zbc-l
Copy link

zbc-l commented Feb 17, 2023

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
Copy link
Author

zbc-l commented Feb 17, 2023

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.

@jiangwei221
Copy link
Collaborator

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
Copy link
Author

zbc-l commented Feb 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants