zju3dv / EfficientLoFTR

Apache License 2.0
635 stars 48 forks source link

x_mask and source_mask is None #32

Closed spacycoder closed 3 months ago

spacycoder commented 3 months ago

Hi, great work!

Quick question, why do you assert that x_mask and source_mask should be None here:

https://github.com/zju3dv/EfficientLoFTR/blob/68eb9218c1bdd179db9a07ad4771161b198d98b3/src/loftr/loftr_module/transformer.py#L65

Shouldn't the masks be applied to the qkv tensors? The rest of the code seems to allow for x_mask and source_mask to be available

wyf2020 commented 3 months ago

Thank you for your question! Currently, our code only support padding mask and will crop image by padding mask before transformer. If you want to use mask of generalized shape, you can pass the mask into here and modify the parameter of F.scaled_dot_product_attention or add a manually mask like LoFTR. We will provide config choice for this operation soon. For more detailed explanation, you can also have a look at this issue.

spacycoder commented 3 months ago

OK, thanks!