Skip to content

Commit

Permalink
Solved #53 (comment)
Browse files Browse the repository at this point in the history
In PyTorch 1.4.x (index/128) at https://github.com/zhou13/lcnn/blob/88f281ab5421d51a62f1f84f97fea05afbf0c8d8/lcnn/models/line_vectorizer.py#L174 outputs integer values but in PyTorch 1.8.x it outputs float values. Updating it with (index//128) outputs integer values in both PyTorch versions and solves #53 (comment).
  • Loading branch information
ibrahim-601 authored Sep 27, 2021
1 parent 88f281a commit 6c0590b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lcnn/models/line_vectorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6c0590b

Please sign in to comment.