Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about converting custom dataset to coco api #1617

Closed
kangkang59812 opened this issue Nov 27, 2019 · 1 comment
Closed

Question about converting custom dataset to coco api #1617

kangkang59812 opened this issue Nov 27, 2019 · 1 comment

Comments

@kangkang59812
Copy link
Contributor

kangkang59812 commented Nov 27, 2019

bboxes[:, 2:] -= bboxes[:, :2]

If the box is [3,10,6,20](xyxy format),the converted box should be [3,10,4,11]. I think this code should be added 1. Because there are 4 pixels between [3,6] and 11 pixels between [10,20]. It actually computes the pixels in grid.
May be the original computation of the area need to do this as well. Such as this tutorial, https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
area = (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 2] - boxes[:, 0])

@fmassa
Copy link
Member

fmassa commented Dec 2, 2019

Hi,

This has been discussed in #826 (comment) , and the addition of +1 was removed from torchvision, and we consider box coordinates in terms of continuous coordinates, in which case the +1 is not necessary.

Let me know if you have further questions

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

No branches or pull requests

2 participants