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

Use of masks in feature detection #256

Open
sandeepnmenon opened this issue Mar 29, 2023 · 3 comments
Open

Use of masks in feature detection #256

sandeepnmenon opened this issue Mar 29, 2023 · 3 comments

Comments

@sandeepnmenon
Copy link

Is the purpose of masks to provide padding at the border of the image?

'mask0'(optional) : (torch.Tensor): (N, H, W) '0' indicates a padded position

I have a scenario where I want to detect feature matches in an image except in some area. A mask that I can provide. Like for example, I have some moving objects in the scene and I want LoFTR to ignore them to avoid spurious detections.
Is there a way to provide a mask on the images telling the model to ignore finding feature matches in that area?

PS: I know that I can just ignore the feature matches in the mask after computing. Here I wanted to understand the purpose of these masks in LoFTR model.

@nesi73
Copy link

nesi73 commented Aug 7, 2023

I have the same doubt, did you get something or just post processed it?

@JS901
Copy link

JS901 commented Jan 2, 2024

Hi @zehongs, do you have any thoughts on filtering of keypoints before matching? It looks like the current mask0, mask1 inputs to loftr.forward() are only for padding the edge of the image to remove a black border.

@zehongs
Copy link
Member

zehongs commented Jan 2, 2024

I think the mask should not be considered for the local CNN parts, because that will break the CNN receptive fields. And it is possible for the transformer to handle an arbitrary padding mask. But we use a variant called linear-attention, so I'm not sure about this. You can check it for yourself.

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

4 participants