Fix bbox bottom right corner calculation #314
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The boxes are given in (top left x, top left y, width, height) format. In order to get bottom right corner we need to add width and height to x and y correspondingly and subtract 1.
On the line 62 in
tools/generate_detections.pyyou treat image rect correctly by subtracting 1 from the image box, which is originally (0, 0, w, h) and after subtracting (0, 0, w - 1, h - 1).however, you don't do it in other places across the repo, for example, on line 57 in the same file
By not doing so, you get a pixel that is diagonally to the bottom right corner. This minor inconsistency is really confusing.
There are 2 ways of how to resolve it:
rectcalculation across the codebase (subtract 1 from other rects when converted to (left, top, right, bottom))rectconsistent to otherrectsand do not subtract 1 for the image right bottom cornerI believe the first approach is more reasonable to take as it also fixes how
iouis calculated. Below is an example of how one can figure out the right bottom corner of arect:This is not a critical issue and should not dramatically affect metrics though would be really nice to fix.