快捷方式

RandomVerticalFlip

class torchvision.transforms.RandomVerticalFlip(p=0.5)[source]

以給定的機率隨機垂直翻轉給定的影像。如果影像是 torch Tensor,則期望其形狀為 […, H, W],其中 … 表示任意數量的前導維度。

引數:

p (float) – 影像被翻轉的機率。預設值為 0.5

使用 RandomVerticalFlip 的示例

變換圖示

變換圖示
forward(img)[source]
引數:

img (PIL ImageTensor) – 要翻轉的影像。

返回:

隨機翻轉後的影像。

返回型別:

PIL Image 或 Tensor

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源