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 图像或 Tensor