Randomly flip an image horizontally (left to right). With a 1 in 2 chance, outputs the contents of `image` flipped along the second dimension, which is `width`. Otherwise output the image as-is. Args: image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor of s
(image, seed=None)
| 346 | |
| 347 | @tf_export('image.random_flip_left_right') |
| 348 | def random_flip_left_right(image, seed=None): |
| 349 | """Randomly flip an image horizontally (left to right). |
| 350 | |
| 351 | With a 1 in 2 chance, outputs the contents of `image` flipped along the |
| 352 | second dimension, which is `width`. Otherwise output the image as-is. |
| 353 | |
| 354 | Args: |
| 355 | image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor |
| 356 | of shape `[height, width, channels]`. |
| 357 | seed: A Python integer. Used to create a random seed. See |
| 358 | `tf.compat.v1.set_random_seed` for behavior. |
| 359 | |
| 360 | Returns: |
| 361 | A tensor of the same type and shape as `image`. |
| 362 | |
| 363 | Raises: |
| 364 | ValueError: if the shape of `image` not supported. |
| 365 | """ |
| 366 | return _random_flip(image, 1, seed, 'random_flip_left_right') |
| 367 | |
| 368 | |
| 369 | def _random_flip(image, flip_index, seed, scope_name): |
nothing calls this directly
no test coverage detected