Skip to content

Conversation

@williamcorsel
Copy link
Contributor

The RotatedBbox.wrap() function tries to access wrong attributes. This causes errors in dataset transforms that include rotated bounding boxes. See the example:

"""Minimal reproducible example demonstrating the bug in RotatedBbox.wrap method.

The wrap method tries to access item.x and item.y, but RotatedBbox only has
cx and cy properties (center coordinates), not x and y.
"""

from datumaro.components.annotation import RotatedBbox

bbox = RotatedBbox(cx=100.0, cy=200.0, w=50.0, h=30.0, r=45.0, label=0)
wrapped_bbox = bbox.wrap(label=1)

Checklist

  • I have added tests to cover my changes or documented any manual tests.
  • I have updated the documentation accordingly

@williamcorsel williamcorsel requested a review from a team as a code owner December 23, 2025 15:12
Copilot AI review requested due to automatic review settings December 23, 2025 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug in the RotatedBbox.wrap() method that was attempting to access incorrect attributes (x and y instead of cx and cy). The RotatedBbox class uses center coordinates (cx, cy) rather than top-left coordinates like the Bbox class, and the wrap method needs to correctly reference these attributes.

Key Changes

  • Updated RotatedBbox.wrap() to use cx and cy (center coordinates) instead of the non-existent x and y attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@williamcorsel williamcorsel changed the title Fix RotatedBbox by assigning correct attributes Fix RotatedBbox.wrap() by assigning correct attributes Dec 26, 2025
Copy link
Contributor

@leoll2 leoll2 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@leoll2 leoll2 added this pull request to the merge queue Dec 30, 2025
Merged via the queue into open-edge-platform:develop with commit 6e0f046 Dec 30, 2025
16 checks passed
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.

3 participants