Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

ToPercentCoords #39

Open
EddieEduardo opened this issue Dec 7, 2019 · 0 comments
Open

ToPercentCoords #39

EddieEduardo opened this issue Dec 7, 2019 · 0 comments

Comments

@EddieEduardo
Copy link

Why do I think there is a tiny inaccurate place in Fuction ToPercentCoords in utils/augmentations.py in line 85-96 ?

It feels like the following lines
"""
boxes_pre[:, 0] /= width
boxes_pre[:, 2] /= width
boxes_pre[:, 1] /= height
boxes_pre[:, 3] /= height
boxes_next[:, 0] /= width
boxes_next[:, 2] /= width
boxes_next[:, 1] /= height
boxes_next[:, 3] /= height
"""
should be corrected as:
"""
boxes_pre[:, 0] /= width-1
boxes_pre[:, 2] /= width-1
boxes_pre[:, 1] /= height-1
boxes_pre[:, 3] /= height-1
boxes_next[:, 0] /= width-1
boxes_next[:, 2] /= width-1
boxes_next[:, 1] /= height-1
boxes_next[:, 3] /= height-1
"""
cause when I used the original codes as an example to extract a specific number in a tensor by means of function torch.nn.functional.grid_sample, it wouldn't get the expected number, but when I changed width/height to width-1/height-1 , it came out the expected number.
Does anyone have the same confusion?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant