-
-
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
Question about YOLO format in convert_bbox_to_albumentations
#883
Comments
There's a flaw in this idea: the bounding boxes will only get larger for every transformation. This might not be a good idea especially when using a lot of transformations. |
Why do the
that omits the pixel errors in the first place. Is there a particular reason why it is not like this? |
It looks like a bug that needs to be fixed. |
Should be fixed by #924 |
Hi, I was looking through this part of
convert_bbox_to_albumentations
:albumentations/albumentations/augmentations/bbox_utils.py
Lines 232 to 244 in 95a048d
Suppose the call
x, y, width, height = denormalize_bbox(bbox, rows, cols)
yieldsx
=y
= 4.0width
=height
= 3.0for
rows
=cols
= 5. This would givex_min
a value of 3.0 andx_max
a value of 6.0, i.e.,x_max
is greater thancols
. The current implementation seems to shift the bbox 1 pixel to the right (and 1 pixel downwards).With that said, would it be better to replace the definitions of
x_min
andx_max
(and similarly fory_min
andy_max
) as follows?Having the
+ 1
in the calculation ofx_max
instead ofx_min
enlarges the bbox by at most 2 pixels to the left and to the right but ensures that the object is still enclosed by the bbox. Themax(..., 0)
andmin(..., cols)
ensure thatx_min
andx_max
are within acceptable values.The text was updated successfully, but these errors were encountered: