RandomVerticalFlip

class torchaug.transforms.RandomVerticalFlip(p=0.5, batch_inplace=False, batch_transform=False)[source]

Vertically flip the input with a given probability.

If the input is a torch.Tensor or a TATensor (e.g. Image, Video, BoundingBoxes etc.) it can have arbitrary number of leading batch dimensions. For example, the image can have [..., C, H, W] shape. A bounding box can have [..., 4] shape.

Parameters:
  • p (float, optional) – probability of the input being flipped. Default: 0.5

  • batch_inplace (bool, optional) – whether to apply the batch transform in-place. Does not prevent functionals to make copy but can reduce time and memory consumption. Default: False

  • batch_transform (bool, optional) – whether to apply the transform in batch mode. Default: False