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的示例