RandomEqualize¶ class torchvision.transforms.RandomEqualize(p=0.5)[source]¶ 以給定機率隨機均衡給定影像的直方圖。如果影像是 torch Tensor,則期望其形狀為 […, 1 或 3, H, W],其中 … 表示任意數量的前導維度。如果 img 是 PIL Image,則期望其模式為 “P”、“L” 或 “RGB”。 引數: p (float) – 影像被均衡化的機率。預設值為 0.5 使用 RandomEqualize 的示例 變換示例 變換示例 forward(img)[source]¶ 引數: img (PIL Image 或 Tensor) – 要均衡化的影像。 返回值: 隨機均衡化的影像。 返回型別: PIL Image 或 Tensor