shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

RandomHorizontalFlip() In PyTorch

RandomHorizontalFlip() flips an image randomly and horizontally. It takes 2 args: img (PIL Image or tensor) & p (probability of flip). Example usage: RandomHorizontalFlip(p=0.5)

Buy Me a Coffee☕
*Memos:

My post explains RandomVerticalFlip().
My post explains OxfordIIITPet().

RandomHorizontalFlip() can flip an image randomly and horizontally as shown below:
*Memos:

The 1st argument for initialization is p(Optional-Default:0.5-Type:int or float):
*Memos:

It's the probability of whether an image is flipped or not.
It must be 0 <= x <= 1.


The 1st argument is img(Required-Type:PIL Image or tensor(int)):
*Memos:

A tensor must be 2D or 3D.
Don't use img=.



v2 is recommended to use according to V1 or V2? Which one should I use?.


from torchvision.datasets import Ox...