-
Notifications
You must be signed in to change notification settings - Fork 7k
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
[proto] Added functional affine_bounding_box
op
#5597
Conversation
💊 CI failures summary and remediationsAs of commit c398dad (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
833fa10
to
f2ba134
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vfdev-5. Few very minor comments and a couple of questions. Let me know what you think.
6683efe
to
a24fca7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Added a cude/cpu test Reduced the number of test samples
@@ -233,3 +276,154 @@ def test_eager_vs_scripted(functional_info, sample_input): | |||
scripted = jit.script(functional_info.functional)(*sample_input.args, **sample_input.kwargs) | |||
|
|||
torch.testing.assert_close(eager, scripted) | |||
|
|||
|
|||
def _compute_affine_matrix(angle_, translate_, scale_, shear_, center_): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored this method as it will be reused for affine segm mask tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Summary: * Added functional affine_bounding_box op with tests * Updated comments and added another test case * Update _geometry.py * Fixed device mismatch issue Added a cude/cpu test Reduced the number of test samples (Note: this ignores all push blocking failures!) Reviewed By: YosuaMichael Differential Revision: D35216788 fbshipit-source-id: 4ae3e959f9246409bd5a39013c3720cfd409031a
Related to #5514
Description:
affine_bounding_box
opQuestions:
angle
parameter (affine op) performs clockwise rotation. For D2 and albu does counter clockwise rotation. Should we align our proto API to that ? Pillow rotate and the stable API rotate op does also counter clockwise rotation.vision/torchvision/transforms/functional.py
Line 1004 in 8aadef5
vision/torchvision/transforms/functional.py
Line 1092 in 8aadef5
=>
We assume that
affine_image_tensor
==F.affine
and must be BC, so let's keep current behaviour.Opened related RFC: #5608
Compare with albumentations:
Code and results. TL;DR: results should match
Output:
Results on synthetic images/bboxes:
Code
Output boxes