RandomHorizontalFlip¶
- class torchaug.transforms.RandomHorizontalFlip(p=0.5, batch_inplace=False, batch_transform=False)[source]¶
Horizontally flip the input with a given probability.
If the input is a
torch.Tensoror aTATensor(e.g.Image,Video,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[..., 4]shape.- Parameters:
p (
float, optional) – probability of the input being flipped. 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