Closed mkmenta closed 3 years ago
@mkmenta thanks, looks like a potential issue, I'll dig in more over next few days
Thinking it should be as per below, to ensure clipping to either target image bounds or letterboxing, whichever is smaller.
clip_boxes_(bbox, (min(scaled_h, self.target_size[0]), min(scaled_w, self.target_size[1])))
That's true! Sorry, I missed that.
@mkmenta I'm testing #186 in training
First of all, thanks for your hard and great work!
Describe the bug I think that the bounding boxes are not clipped or removed correctly if their coordinates come out from the right and bottom edges in the data transformations of
RandomResizePad
andResizePad
.To Reproduce
the code above outputs:
which, if I'm not wrong, shouldn't be correct: we have set the
target_size=512
and the first BBox y2 coordinate is550.16
. The same happens with the second BBox that has its coordinates out of the 512x512 image.Expected behavior The output of that code I think that should be:
(first bbox clipped and second bbox removed).
Screenshots A visualization of what I'm saying. Before: After:
Desktop:
Suggested fix Changing the lines 100 and 162 of
transforms.py
from:to
the code I wrote to reproduce the issue outputs:
Visualization of the transformed image:
Thank you in advance!