RandomVerticalFlip¶ class torchvision.transforms.RandomVerticalFlip(p=0.5)[原始碼]¶ 以給定的機率隨機垂直翻轉給定的影像。如果影像為 torch Tensor,則預期其形狀為 […, H, W],其中 … 表示任意數量的 leading dimensions 參數: p (float) – 影像被翻轉的機率。預設值為 0.5 使用 RandomVerticalFlip 的範例 轉換的圖例 轉換的圖例 forward(img)[原始碼]¶ 參數: img (PIL Image 或 Tensor) – 要翻轉的影像。 回傳: 隨機翻轉的影像。 回傳類型: PIL Image 或 Tensor