RandomInvert

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

Inverts the colors of the given image or video with a given probability.

The input is expected to be in […, 1 or 3, H, W] format, where … means it can have an arbitrary number of leading dimensions.

Parameters:
  • p (float, optional) – probability of the image being color inverted. 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

extra_repr()[source]

Set the extra representation of the transform.

Return type:

str