tfm.vision.preprocess_ops.random_horizontal_flip

Randomly flips input image and bounding boxes and/or masks horizontally.

Expects input tensors without the batch dimension; i.e. for RGB image assume rank-3 input like [h, w, c], for masks assume either [h, w, 1] or [1, h, w].

image tf.Tensor, the image to apply the random flip, [h, w, channels].
normalized_boxes tf.Tensor or None, boxes corresponding to the image.
masks tf.Tensor or None, masks corresponding to the image, [h, w, 1] or [1, h, w].
seed Seed for Tensorflow's random number generator.
prob A float from 0 to 1 indicating the probability of flipping the input horizontally.

image tf.Tensor, flipped image.
boxes tf.Tensor or None, flipped normalized boxes corresponding to the image.
masks tf.Tensor or None, flipped masks corresponding to the image.