Data Transforms - RandomTranspose?

Hi,
I would like to perform some data augmentation on the images with

transforms.RandomHorizontalFlip(),
transforms.RandomVerticalFlip(),

I would also like to do another transform like a RandomTranspose()?
Please help
Thank You

Hi,

There is no built-in function/transformation available in Pytorch for Random Transpose. But you can build a custom data loader and call transpose on image tensor randomly. Something like this. In __getitem__ function you have to set a flag true/false randomly and on the basis of that flag you can apply your Transpose transformation.

1 Like

Hey, Thanks alot Yash :slight_smile: It is working …

1 Like