Skip to content

Commit

Permalink
Bugfix: LoFTR was ignoring mask input (#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yosshi999 committed Jun 10, 2024
1 parent 1e0e648 commit e17ce88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kornia/feature/loftr/loftr.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def forward(self, data: dict[str, Tensor]) -> dict[str, Tensor]:
feat_c1 = feat_c1.reshape(n1, -1, c1)

mask_c0 = mask_c1 = None # mask is useful in training
if "mask0" in _data:
if "mask0" in data:
mask_c0 = resize(data["mask0"], _data["hw0_c"], interpolation="nearest").flatten(-2)
if "mask1" in _data:
if "mask1" in data:
mask_c1 = resize(data["mask1"], _data["hw1_c"], interpolation="nearest").flatten(-2)
feat_c0, feat_c1 = self.loftr_coarse(feat_c0, feat_c1, mask_c0, mask_c1)

Expand Down

0 comments on commit e17ce88

Please sign in to comment.