- class torchvision.transforms.v2.RandomHorizontalFlip(p: float = 0.5)¶
[BETA] Horizontally flip the input with a given probability.
The RandomHorizontalFlip transform is in Beta stage, and while we do not expect disruptive breaking changes, some APIs may slightly change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753.
If the input is a
BoundingBoxesetc.) it can have arbitrary number of leading batch dimensions. For example, the image can have
[..., C, H, W]shape. A bounding box can have
p (float, optional) – probability of the input 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 class