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