Skip to content

Conversation

@michal-lightly
Copy link
Contributor

@michal-lightly michal-lightly commented Jan 19, 2026

What has changed and why?

The bounding box was incorrectly computed. The xmax and ymax values are not the x- and y-coordinates of the extreme pixels, they are float positions of where they end.

I.e., the computed xmax and ymax values should be one larger.

How has it been tested?

Updated the test.

def test_from_rle(self) -> None:
binary_mask_segmentation = BinaryMaskSegmentation.from_rle(
rle_row_wise=[1, 1, 4, 2, 1, 3, 2, 1, 5],
rle_row_wise=[6, 1, 4, 2, 1, 3, 2, 1],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the test so that the XYXY bounding box format differs from the XYWH format.

@michal-lightly
Copy link
Contributor Author

/review

Copy link
Contributor

@horatiualmasan horatiualmasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michal-lightly michal-lightly merged commit 6fabdf2 into main Jan 20, 2026
2 checks passed
@michal-lightly michal-lightly deleted the michal-20260119-fix-bbox branch January 20, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants