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

Fix for rotating bounding box the wrong way #199

Closed
wants to merge 1 commit into from
Closed

Fix for rotating bounding box the wrong way #199

wants to merge 1 commit into from

Conversation

juliusfrost
Copy link

@juliusfrost juliusfrost commented Mar 9, 2022

Summary

  • I have read CONTRIBUTING.md to understand how to contribute to this repository :)

The current method for rotating bounding boxes was bugged because it rotated the bounding box in the wrong direction. This simple sign change fixes it.

Test case: https://github.com/juliusfrost/AugLy/blob/rotate-bounding-box-jupyter/examples/test_rotate.ipynb

Unit Tests

Passes unit tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 9, 2022
@zpapakipos
Copy link
Contributor

Hi @juliusfrost, thanks for this contribution and surfacing that you've seen unexpected behavior with bounding boxes with the rotate augmentation!

I double checked the PIL source code and the rotation matrix which we currently create in this helper function does align with the rotation matrix used by PIL here.

Can you please prove that there was indeed an issue with the way the calculation is done now (i.e. run a test case & visualize it where the bbox is rotated incorrectly), and show that that case is fixed by this fix?

I want to be careful making changes since this helper function is fairly complex. Thanks!

@juliusfrost
Copy link
Author

@facebook-github-bot
Copy link
Contributor

@zpapakipos has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zpapakipos
Copy link
Contributor

@juliusfrost thank you for the notebook with the thorough test cases! :) Looks good to me; can you just rebase onto the latest main changes to fix the linter error? Then we should be good to go, thanks!

@zpapakipos
Copy link
Contributor

Hi @juliusfrost, reminder to please rebase onto main once #204 has been merged :) (should be within a few minutes)

@facebook-github-bot
Copy link
Contributor

@juliusfrost has updated the pull request. You must reimport the pull request before landing.

2 similar comments
@facebook-github-bot
Copy link
Contributor

@juliusfrost has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@juliusfrost has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@juliusfrost has updated the pull request. You must reimport the pull request before landing.

@juliusfrost
Copy link
Author

@zpapakipos I think it's ready now

@facebook-github-bot
Copy link
Contributor

@zpapakipos has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@juliusfrost juliusfrost deleted the rotate-bouding-box-fix branch March 14, 2022 15:04
zpapakipos pushed a commit to zpapakipos/AugLy that referenced this pull request Mar 28, 2022
Summary:
- [x] I have read CONTRIBUTING.md to understand how to contribute to this repository :)

The current method for rotating bounding boxes was bugged because it rotated the bounding box in the wrong direction. This simple sign change fixes it.

Test case: https://github.com/juliusfrost/AugLy/blob/rotate-bounding-box-jupyter/examples/test_rotate.ipynb

## Unit Tests
Passes unit tests.

Pull Request resolved: facebookresearch#199

Reviewed By: jbitton

Differential Revision: D34813315

Pulled By: zpapakipos

fbshipit-source-id: e1212d2a95a4837ebdc9ff3e97edebb907b93988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants