Convert image to grayscale with a probability of p.

transform_random_grayscale(img, p = 0.1)

Arguments

img

A magick-image, array or torch_tensor.

p

(float): probability that image should be converted to grayscale (default 0.1).