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

[RFC] Different menaning of angle parameter in affine and rotate ops #5608

Open
vfdev-5 opened this issue Mar 14, 2022 · 2 comments
Open

[RFC] Different menaning of angle parameter in affine and rotate ops #5608

vfdev-5 opened this issue Mar 14, 2022 · 2 comments

Comments

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Mar 14, 2022

In Torchvision stable API, there are 2 ops: affine and rotate that has angle as parameter.

However, positive angle parameter in F.affine op performs clockwise rotation.

angle (number): rotation angle in degrees between -180 and 180, clockwise direction.

while in F.rotate it is an opposite meaning, it does counter clockwise rotation:

angle (number): rotation angle value in degrees, counter-clockwise.

For Detectron2, Pillow or albumentations, they do counter clockwise rotation for positive angle value.

Question: Should we align F.affine op to perform counter clockwise rotation for positive angle value ?

cc @vfdev-5 @datumbox

@datumbox
Copy link
Contributor

This is ugly. As we discussed offline, we could take the approach of aligning the two AND on the layer that will ensures BC between new and old API, we could add a method that does the conversion and a deprecation warning. I would probably leave this for after the API is completed.

@pmeier any thoughts on this?

@pmeier
Copy link
Collaborator

pmeier commented Mar 14, 2022

I agree that we should align. Just to make sure that we are on the same page: you want positive angles on the affine_image kernel to mean CCW rotation, and switch the sign for F.affine, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants