You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand correctly, you are saying that we should propose the rotations to be randomly sampled from a discrete subset, instead of having them being sampled from a continuous interval, is that right?
If that's the case, I'd say that having it being sampled from an interval is more generic, and should probably be kept.
Reacted by Francisco Massa, Yangting Sun, Calvin Ku, weigoxp, Sam Wheating, Ivan Ivanov, Phil Filippak, Othman Sbai, Amoko, Eugenio Berretta and 6 more
@fmassa@sotte Thank you both very much!! I came up with this issue mainly because that many papers i encoutered use discrete rotation as data augmentation. Thanks again!
Reacted by Francisco Massa, Ivan Ivanov, Phil Filippak, Billy Zhao, Ricardo Decal, Jiachang Liu, Shubham Wagh, Haswanth Aekula, James Guillochon, Mohammad Reza Taesiri and 12 more
If we add this we should maybe just document the general procedure how you can use TF to build your own transform classes (and use the example from above).
I think a note in the documentation of the functional interface, explaining that it gives full flexibility sounds like best thing to do, with an example for a particular case, like the rotation that you proposed just above
@fmassa I have a use-case which prohibits the use of "generic interval" rotations because it destroys information I need in the corners. In particular, I can only use order-4 symmetry transforms (image attached). Using only reflections (RandomHorizontalFlip and RandomVerticalFlip) I can only get 4 of the 8 possible transforms.
wiki/File:Dih4_cycle_graph.svg
These order-4 symmetry transforms are ubiquitous, for instance, in computer vision for satellite imagery research. I'm surprised that it isn't a built-in.
@crypdick yes, rotations by 90 degrees as you suggest are definitely make sense for satellite, medical imagery and as data augmentations in torchvision. IMO, the reason why this is not yet built-in in torchvision, probably, due to "photography" type of imagery intended to be processed (like ImageNet) where upside-down rotation does not make much sense...
@fmassa I agree that this can be an enhancement for transforms and functional operations.
I agree that having the D_4 group augmentation as shown by @crypdick is very useful for many application ( biological, chemical and satellite data comes to mind).
Activity
[-]Rotation transfomation[/-][+]Rotation transformation[/+]fmassa commentedon Aug 3, 2018
Could you be a bit more clear on what you mean by those three angles?
noeagles commentedon Aug 4, 2018
When images are being randomly rotated, they should be rotated angle1 or angle2 or angle3 degrees, not from (mix, max) degrees
fmassa commentedon Aug 13, 2018
If I understand correctly, you are saying that we should propose the rotations to be randomly sampled from a discrete subset, instead of having them being sampled from a continuous interval, is that right?
If that's the case, I'd say that having it being sampled from an interval is more generic, and should probably be kept.
sotte commentedon Sep 9, 2018
I agree with @fmassa. That being said, @noeagles, you could use the functional transforms and build that functionality yourself.
noeagles commentedon Sep 9, 2018
@fmassa @sotte Thank you both very much!! I came up with this issue mainly because that many papers i encoutered use discrete rotation as data augmentation. Thanks again!
VesninEN commentedon Sep 26, 2019
How it can be used inside the transforms.Compose([...])?
sotte commentedon Sep 27, 2019
Something like this would work:
fmassa commentedon Sep 30, 2019
@sotte do you think this snippet could be added somewhere in torchvision? Maybe in the documentation of
rotate?sotte commentedon Sep 30, 2019
@fmassa Um, if you think it's helpful, sure :)
If we add this we should maybe just document the general procedure how you can use
TFto build your own transform classes (and use the example from above).I guess I could add it to https://pytorch.org/docs/stable/torchvision/transforms.html#functional-transforms.
I can create a PR (let me know if want something specific), but you can also just add the snippet. Both is fine with me.
fmassa commentedon Sep 30, 2019
I think a note in the documentation of the functional interface, explaining that it gives full flexibility sounds like best thing to do, with an example for a particular case, like the rotation that you proposed just above
sotte commentedon Oct 1, 2019
I'll send the PR later today.
crypdick commentedon Jul 23, 2020
@fmassa I have a use-case which prohibits the use of "generic interval" rotations because it destroys information I need in the corners. In particular, I can only use order-4 symmetry transforms (image attached). Using only reflections (RandomHorizontalFlip and RandomVerticalFlip) I can only get 4 of the 8 possible transforms.
wiki/File:Dih4_cycle_graph.svg
These order-4 symmetry transforms are ubiquitous, for instance, in computer vision for satellite imagery research. I'm surprised that it isn't a built-in.
fmassa commentedon Jul 30, 2020
@crypdick that is a valid point.
@vfdev-5 thoughts on this?
vfdev-5 commentedon Aug 2, 2020
@crypdick yes, rotations by 90 degrees as you suggest are definitely make sense for satellite, medical imagery and as data augmentations in torchvision. IMO, the reason why this is not yet built-in in torchvision, probably, due to "photography" type of imagery intended to be processed (like ImageNet) where upside-down rotation does not make much sense...
@fmassa I agree that this can be an enhancement for transforms and functional operations.
YannDubs commentedon Apr 6, 2021
I agree that having the D_4 group augmentation as shown by @crypdick is very useful for many application ( biological, chemical and satellite data comes to mind).
It is very easy to get it though:
But a shorthand and quicker version might be useful.
[LLM] Initial version of the PaxML implementation (pytorch#566)