AutoAugment¶
- 类 torchvision.transforms.AutoAugment(policy: AutoAugmentPolicy = AutoAugmentPolicy.IMAGENET, interpolation: InterpolationMode = InterpolationMode.NEAREST, fill: Optional[List[float]] = None)[source]¶
基于 “AutoAugment: Learning Augmentation Strategies from Data” 的 AutoAugment 数据增强方法。如果图像是 torch Tensor,它应该是 torch.uint8 类型,并且期望具有 […, 1 或 3, H, W] 形状,其中 … 表示任意数量的起始维度。如果 img 是 PIL Image,期望其模式为 “L” 或 “RGB”。
- 参数:
**policy** (AutoAugmentPolicy) – 由
torchvision.transforms.autoaugment.AutoAugmentPolicy
定义的所需策略枚举。默认为AutoAugmentPolicy.IMAGENET
。**interpolation** (InterpolationMode) – 由
torchvision.transforms.InterpolationMode
定义的所需插值枚举。默认为InterpolationMode.NEAREST
。如果输入是 Tensor,仅支持InterpolationMode.NEAREST
,InterpolationMode.BILINEAR
。**fill** (序列或数字, 可选) – 变换后图像区域外的像素填充值。如果给定一个数字,该值将分别用于所有波段。
使用
AutoAugment
的示例