快捷方式

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 (sequencenumber, 可選) – 轉換後圖像外部區域的畫素填充值。如果給定一個數字,則該值分別用於所有通道。

使用 TrivialAugmentWide 的示例

轉換圖示

轉換圖示
forward(img: Tensor) Tensor[原始碼]

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

返回:

轉換後的影像。

返回型別:

PIL 影像或張量

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源