RandomSolarize¶
- class torchaug.transforms.RandomSolarize(threshold, p=0.5, batch_inplace=False, batch_transform=False)[source]¶
Solarize the image or video with a given probability by inverting all pixel values above a threshold.
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:
threshold (
float) – all pixels equal or above this value are inverted.p (
float, optional) – probability of the image being solarized. Default:0.5batch_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:Falsebatch_transform (
bool, optional) – whether to apply the transform in batch mode. Default:False