RandomVerticalFlip¶ class torchvision.transforms.RandomVerticalFlip(p=0.5)[source]¶ 以給定的機率隨機垂直翻轉給定的影像。如果影像是 torch Tensor,則期望其形狀為 […, H, W],其中 … 表示任意數量的前導維度。 引數: p (float) – 影像被翻轉的機率。預設值為 0.5 使用 RandomVerticalFlip 的示例 變換圖示 變換圖示 forward(img)[source]¶ 引數: img (PIL Image 或 Tensor) – 要翻轉的影像。 返回: 隨機翻轉後的影像。 返回型別: PIL Image 或 Tensor