RandomTransform#
- class torchaug.transforms.RandomTransform(p)[source]#
Abstract class to make a base class for all random transforms.
- Parameters:
p (
float) – Probability to apply the transform.
- abstract apply_transform(img)[source]#
Function to perform transformation on the image.
Note
Should be overridden by subclasses.
- Parameters:
img (
Tensor) – Image to transform.- Returns:
The transformed image.
- forward(img)[source]#
Call
apply_transform()based on random sample.- Parameters:
img (
Tensor) – Image to randomly transform based onp.- Returns:
The randomly transformed image.