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], Union[int, float, collections.abc.Sequence[int], collections.abc.Sequence[float], NoneType]] = 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, optional) – 不同幅度值的數量。
interpolation (InterpolationMode, optional) – 由
torchvision.transforms.InterpolationMode定義的期望的插值列舉。預設為InterpolationMode.NEAREST。如果輸入是 Tensor,則只支援InterpolationMode.NEAREST和InterpolationMode.BILINEAR。fill (sequence 或 number, 可選) – 轉換後圖像外部區域的畫素填充值。如果給定一個數字,則該值分別用於所有通道。
使用
TrivialAugmentWide的示例