TrivialAugmentWide¶
- 类 torchvision.transforms.v2.TrivialAugmentWide(num_magnitude_bins: int = 31, interpolation: Union[InterpolationMode, int] = InterpolationMode.NEAREST, fill: Union[int, float, Sequence[int], Sequence[float], None, Dict[Union[Type, str], Optional[Union[int, float, Sequence[int], Sequence[float]]]]] = None)[source]¶
使用 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
的示例