RandomAutocontrast¶ class torchvision.transforms.RandomAutocontrast(p=0.5)[原始碼]¶ 以給定機率隨機自動對比給定影像的畫素。如果影像是 torch Tensor,它應該具有 [..., 1 或 3, H, W] 的形狀,其中 ... 表示任意數量的前導維度。如果 img 是 PIL Image,它應該處於“L”或“RGB”模式。 引數: p (float) – 影像自動對比的機率。預設值為 0.5 使用 RandomAutocontrast 的示例 轉換圖示 轉換圖示 forward(img)[原始碼]¶ 引數: img (PIL Image 或 Tensor) – 要自動對比的影像。 返回: 隨機自動對比的影像。 返回型別: PIL 影像或張量