Randomly flips input image and bounding boxes horizontally.
tfm.vision.preprocess_ops.random_horizontal_flip_with_roi(
image: tf.Tensor,
boxes: Optional[tf.Tensor] = None,
masks: Optional[tf.Tensor] = None,
roi_boxes: Optional[tf.Tensor] = None,
seed: int = 1
) -> Tuple[tf.Tensor, Optional[tf.Tensor], Optional[tf.Tensor], Optional[tf.Tensor]]
Extends preprocess_ops.random_horizontal_flip to also flip roi_boxes used
by ViLD.
Args |
image
|
tf.Tensor , the image to apply the random flip.
|
boxes
|
tf.Tensor or None , boxes corresponding to the image.
|
masks
|
tf.Tensor or None , masks corresponding to the image.
|
roi_boxes
|
tf.Tensor or None , RoIs corresponding to the image.
|
seed
|
Seed for Tensorflow's random number generator.
|
Returns |
image
|
tf.Tensor , flipped image.
|
boxes
|
tf.Tensor or None , flipped boxes corresponding to the image.
|
masks
|
tf.Tensor or None , flipped masks corresponding to the image.
|
roi_boxes
|
tf.Tensor or None , flipped RoIs corresponding to the image.
|