TrivialAugmentWide¶
- class torchvision.transforms.TrivialAugmentWide(num_magnitude_bins: int = 31, interpolation: InterpolationMode = InterpolationMode.NEAREST, fill: Optional[List[float]] = None)[source]¶
使用 TrivialAugment Wide 进行数据集无关的数据增强,如 《TrivialAugment: 免调参但达到 SOTA 的数据增强》中所述。如果图像是 torch Tensor,类型应为 torch.uint8,并且预期形状为 […, 1 或 3, H, W],其中 … 表示任意数量的前导维度。如果 img 是 PIL Image,预期模式为 “L” 或 “RGB”。
- 参数:
num_magnitude_bins (int) – 不同幅度值的数量。
interpolation (InterpolationMode) – 由
torchvision.transforms.InterpolationMode
定义的所需插值模式枚举。默认为InterpolationMode.NEAREST
。如果输入是 Tensor,仅支持InterpolationMode.NEAREST
、InterpolationMode.BILINEAR
。fill (sequence or number, optional) – 变换后图像区域外的像素填充值。如果给定一个数字,该值将分别用于所有波段。
使用
TrivialAugmentWide
的示例