Horizontally flip an image randomly with a given probability. The image can be a Magick Image or a torch Tensor, in which case it is expected to have [..., H, W] shape, where ... means an arbitrary number of leading dimensions

transform_random_horizontal_flip(img, p = 0.5)

Arguments

img

A magick-image, array or torch_tensor.

p

(float): probability of the image being flipped. Default value is 0.5