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

Fix bounding box conversion from yolo format #1498

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions albumentations/core/bbox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ def convert_bbox_to_albumentations(
(x, y, w, h), tail = bbox[:4], bbox[4:]

w_half, h_half = w / 2, h / 2
x_min = x - w_half
y_min = y - h_half
x_min = max(0, x - w_half)
y_min = max(0, y - h_half)
x_max = x_min + w
y_max = y_min + h
else:
Expand Down
Loading