Skip to content
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

improve affine bounding box reference helper #7884

Merged
merged 5 commits into from
Aug 28, 2023

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Aug 25, 2023

Improvements for reference_affine_bounding_boxes_helper:

  1. Pass a datapoints.BoundingBoxes directly rather than a torch.Tensor with explicit metadata
  2. Automatic wrapping of the output into datapoints.BoundingBoxes
  3. Support for expand=True, which is needed for the bounding box correctness tests of F.rotate and F.resize

cc @vfdev-5

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 25, 2023

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit f497a9e with merge base fae5321 (image):

NEW FAILURES - The following jobs have failed:

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

@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:01 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:02 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:02 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:02 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:02 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:02 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:09 — with GitHub Actions Inactive
Comment on lines +806 to +807
# Estimate meta-data for image with inverted=True
affine_vector = _get_inverse_affine_matrix(center, angle, translate, scale, shear)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:47 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 11:48 — with GitHub Actions Inactive
@pmeier pmeier requested a review from NicolasHug August 25, 2023 12:24
@pmeier pmeier temporarily deployed to pytorchbot-env August 25, 2023 13:23 — with GitHub Actions Inactive
@pmeier pmeier requested a review from vfdev-5 August 28, 2023 07:51
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

LGTM, although it is a bit complicated to trace all edge cases this updates can bring.
Let's on the CI

@pmeier
Copy link
Collaborator Author

pmeier commented Aug 28, 2023

After trying to use the new helper for F.crop I realized that having a canvas_size overwrite is indeed needed (same for F.pad). Thus, having expand was only sufficient for the correctness tests of F.rotate and F.resize. I've removed expand from the helper again, but kept the functionality for the correctness test for F.rotate.

Thus, point 3. in #7884 (comment) now changes to

  • Add support for F.rotate bounding boxes correctness tests with expand=True

Point 1. and 2. are still valid.

@pmeier pmeier merged commit 6472a5c into pytorch:main Aug 28, 2023
61 of 63 checks passed
@pmeier pmeier deleted the affine-box-helper branch August 28, 2023 12:54
@github-actions
Copy link

Hey @pmeier!

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 Sep 6, 2023
Summary: (Note: this ignores all push blocking failures!)

Reviewed By: matteobettini

Differential Revision: D48900391

fbshipit-source-id: 1d28073ec3059ff6815e9d7cdf5c3ea054acd71f
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.

4 participants