Skip to content

Conversation

@AntoineSimoulin
Copy link
Member

This PR fixes the rotated box format conversion from XYXYXYXY to XYWHR for both meta and ops directories. The conversion formula from #8841 was incorrect. We now compute $w = \sqrt{(x3 - x1)^2 + (y1 - y3)^2}$ and $h = \sqrt{(x3 - x2)^2 + (y3 - y2)^2}$.

We add tests to cover this conversion types. Please run the tests with:

pytest test/test_transforms_v2.py -vvv -k "TestConvertBoundingBoxFormat"
pytest test/test_ops.py -vvv -k TestBoxConvert

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 15, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9019

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 6a8655b with merge base d84aa89 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@AntoineSimoulin AntoineSimoulin changed the title Fix rotated box format conversion from XYXYXYXY to XYWHR r Fix rotated box format conversion from XYXYXYXY to XYWHR Apr 15, 2025
Copy link
Member

@NicolasHug NicolasHug 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 @AntoineSimoulin !

@AntoineSimoulin AntoineSimoulin merged commit ac7ad5f into pytorch:main Apr 16, 2025
58 checks passed
@github-actions
Copy link

Hey @AntoineSimoulin!

You merged this PR, but no labels were added.
The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

facebook-github-bot pushed a commit that referenced this pull request Jul 30, 2025
)

Reviewed By: AntoineSimoulin

Differential Revision: D79175029

fbshipit-source-id: 210cb6ae76c1793cd61728d9cdf1897e137c992e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants