diff --git a/lcnn/models/line_vectorizer.py b/lcnn/models/line_vectorizer.py index a40e922..b6a6eff 100644 --- a/lcnn/models/line_vectorizer.py +++ b/lcnn/models/line_vectorizer.py @@ -171,7 +171,7 @@ def sample_lines(self, meta, jmap, joff, mode): # index: [N_TYPE, K] score, index = torch.topk(jmap, k=K) - y = (index / 128).float() + torch.gather(joff[:, 0], 1, index) + 0.5 + y = (index // 128).float() + torch.gather(joff[:, 0], 1, index) + 0.5 x = (index % 128).float() + torch.gather(joff[:, 1], 1, index) + 0.5 # xy: [N_TYPE, K, 2]