Skip to content

Fix rotated box format conversion from XYXYXYXY to XYWHR #9019

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

Merged

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 = ( x 3 x 1 ) 2 + ( y 1 y 3 ) 2 and h = ( x 3 x 2 ) 2 + ( y 3 y 2 ) 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

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
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

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.

None yet

3 participants