AutoAugment¶
- class torchaug.transforms.AutoAugment(policy=AutoAugmentPolicy.IMAGENET, interpolation=InterpolationMode.NEAREST, fill=None)[source]¶
AutoAugment data augmentation method based on “AutoAugment: Learning Augmentation Strategies from Data”.
This transformation works on images and videos only.
If the input is
torch.Tensor, it should be of typetorch.uint8, and it is expected to have […, 1 or 3, H, W] shape, where … means an arbitrary number of leading dimensions.- Parameters:
policy (
AutoAugmentPolicy, optional) – Desired policy enum defined bytorchvision.transforms.autoaugment.AutoAugmentPolicy. Default:AutoAugmentPolicy.IMAGENETinterpolation (
Union[InterpolationMode,int], optional) – Desired interpolation enum defined bytorchvision.transforms.InterpolationMode. If input is Tensor, onlyInterpolationMode.NEAREST,InterpolationMode.BILINEARare supported. Default:InterpolationMode.NEARESTfill (
Union[int,float,Sequence[int],Sequence[float],None,Dict[Union[Type,str],Union[int,float,Sequence[int],Sequence[float],None]]], optional) – Pixel fill value for the area outside the transformed image. If given a number, the value is used for all bands respectively. Default:None