- class torchvision.transforms.RandomHorizontalFlip(p=0.5)¶
Horizontally flip the given image randomly with a given probability. If the image is torch Tensor, it is expected to have […, H, W] shape, where … means an arbitrary number of leading dimensions
p (float) – probability of the image being flipped. Default value is 0.5
RandomHorizontalFlip:Getting started with transforms v2Illustration of transformsTransforms v2: End-to-end object detection/segmentation exampleHow to use CutMix and MixUpHow to write your own v2 transformsHow to write your own TVTensor classTorchscript support
img (PIL Image or Tensor) – Image to be flipped.
Randomly flipped image.
- Return type:
PIL Image or Tensor