-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Random Crop yields incorrect value for bounding box #903
Comments
I wanted to come back and give a simpler example to fully zoom in on the syntax that I must not be understanding. This passes If you have a box at 100/1000 and make a 200 pixel crop starting at 0, the final bbox coordinate should be 0.5
If you shift everything over 100 pixels, the logic holds.
but if you have begin the crop at any position besides 0, you get a strange result?
The size of the box is correct, but the final bbox start coordinate should be 0,0 since, h_start == bbox[0] and w_start == bbox[1]? Digging into the function, you can see that 'get_random_crop_coords' produces a non-unintuitive result?
I would expect a 200 pixel crop starting at 0.1 with an original image size of 1000 to have crop coordinates of 100,300, not 80,280. Where is the 20 offset coming from? Going one layer deeper to
Why is this not
The size of the crop does not effect the location of the min coordinate, only the location of the max coordinate. Any crop starting at 0.1 of a 1000 row image should have a y1 coordinate of 100, regardless of crop size? |
Because if we will use |
Bad idea, because we have transforms that used current logic and these changes will break their functionality.
I agree, it would be great to add explanation of how this function works.
It would be great. We will wait for your PR. |
Btw padding an image produces also wrong bounding boxes. All bboxes are shifted to the left and to the top on the padded image. |
Can you show an example, i've been running into similar problems.
…On Wed, May 26, 2021 at 10:04 AM Dimfred ***@***.***> wrote:
Btw padding an image produces also wrong bounding boxes. All bboxes are
shifted to the left and to the top on the padded image.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#903 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJHBLCLXXTEXPPFQSBDVOTTPUS2HANCNFSM45KA5YCA>
.
--
Ben Weinstein, Ph.D.
Postdoctoral Fellow
University of Florida
http://benweinstein.weebly.com/
|
Sure, so the first image is one from the padded, and the second one from an unpadded case. The green bounding box is the ground truth. Super bad for me have to redo 10 days of grid search for my thesis, super annoying... There are like 3 - 4 pixels difference. |
So far I see in |
I can see similar behavior
@Dipet I will work on a reproducible example tomorrow. I believe all of these issues are related to the normalization. I am using pascal, not yolo. I will rerun with
|
Are you also transforming your bounding boxes? Or only the image? Because your result looks like you are not transforming the bounding boxes, or you don't put the class to the back. Your results are like really broke, but look at mine the bounding box is shifted only some pixels. |
So I fixed the errors for me by changing the conversion in So instead of convertig to absolute I removed it and now with the coordinates I get from yolo
and vice versa in the |
Should be fixed by #924 |
Could you please tell us in what function you propose this change? Thank you! |
🐛 Bug
The
bbox_random_crop
function does not produce a reasonable result. Consider the following snippet of code.To Reproduce
Expected behavior
A augmented bbox that is fully within the image crop. The crop_height plus the start of the crop is larger than the y2 of the bounding box, but 1.29 coordinate in the cropped box suggestion it is outside of the crop area.
Environment
conda
,pip
, source): pipAdditional context
I am making a custom augmentation to Zoom in on a given bounding box. CropSafe (but not all boxes). Is there syntax that i'm misunderstanding, it doesn't feel like this could be the case. Dtype issue?
The text was updated successfully, but these errors were encountered: