捷徑

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.NEARESTInterpolationMode.BILINEAR

  • fill (序列數字, 選填) – 轉換後影像外部區域的像素填充值。 如果給定一個數字,則該值將分別用於所有通道。

使用 TrivialAugmentWide 的範例

轉換的圖例

轉換的圖例
forward(img: Tensor) Tensor[source]

img (PIL Image 或 Tensor): 要轉換的影像。

回傳:

轉換後的影像。

回傳型別:

PIL Image 或 Tensor

文件

存取 PyTorch 的完整開發人員文件

檢視文件

教學

取得針對初學者和進階開發人員的深入教學

檢視教學

資源

尋找開發資源並取得問題解答

檢視資源