Skip to content

Fix _parallelogram_to_bounding_boxes #9181

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AntoineSimoulin
Copy link
Member

This PR adjust the behavior of _parallelogram_to_bounding_boxes. Instead of transforming a parallelogram into a rectangle based on the largest input diagonal, the function returns the minimum area rectangle covering the initial parallelogram. When applying transforms to input rotated bounding boxes, the output tend to be closer to the original boxes and therefore more consistent.

We illustrate below the impact when applying the transforms v2.RandomPerspective(distortion_scale=0.6, p=1.0) in the tutorial to transforms on Rotated Bounding Boxes.

Before fix:
image

After fix:
image

Copy link

pytorch-bot bot commented Aug 12, 2025

🔗 Helpful Links

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

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

❌ 15 New Failures

As of commit 0a2a419 with merge base b818d32 (image):

NEW FAILURES - The following jobs have failed:

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

@meta-cla meta-cla bot added the cla signed label Aug 12, 2025
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.

1 participant