TrivialAugmentWide¶
- class 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 or 3, H, W] 形狀,其中 … 表示任意數量的 leading dimensions。如果 img 是 PIL Image,則預期為 “L” 或 “RGB” 模式。- 參數:
num_magnitude_bins (int, optional) – 不同 magnitude 值的數量。
interpolation (InterpolationMode, optional) – 期望的插值 enum,由
torchvision.transforms.InterpolationMode
定義。預設為InterpolationMode.NEAREST
。如果輸入是 Tensor,則僅支援InterpolationMode.NEAREST
、InterpolationMode.BILINEAR
。fill (sequence or number, optional) – 轉換後影像外部區域的像素填充值。如果給定一個數字,則該值分別用於所有 band。
使用
TrivialAugmentWide
的範例