TrivialAugmentWide¶
- class torchvision.transforms.TrivialAugmentWide(num_magnitude_bins: int = 31, interpolation: InterpolationMode = InterpolationMode.NEAREST, fill: Optional[list[float]] = None)[源代码]¶
独立于数据集的数据增强,使用 TrivialAugment Wide,如 “TrivialAugment: Tuning-free Yet State-of-the-Art Data Augmentation” 中所述。如果图像是 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 或 number, 可选) – 转换后图像外部区域的像素填充值。如果给定一个数字,则该值分别用于所有通道。
使用
TrivialAugmentWide
的示例