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的示例