Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Fixes bug that influences LoFTR training (#1854)

Georg Bökman31ff8b2f6c0f
diff --git a/kornia/feature/loftr/utils/coarse_matching.py b/kornia/feature/loftr/utils/coarse_matching.py
index 147186558..1881eaedb 100644
--- a/kornia/feature/loftr/utils/coarse_matching.py
+++ b/kornia/feature/loftr/utils/coarse_matching.py
@@ -203,7 +203,7 @@ class CoarseMatching(nn.Module):
num_matches_train = num_candidates_max * self.train_coarse_percent
num_matches_train = int(num_matches_train)
num_matches_pred = len(b_ids)
- if self.train_pad_num_gt_min < num_matches_train:
+ if self.train_pad_num_gt_min >= num_matches_train:
msg = "min-num-gt-pad should be less than num-train-matches"
raise ValueError(msg)