Randomly flips an image vertically (upside down). With a 1 in 2 chance, outputs the contents of `image` flipped along the first dimension, which is `height`. Otherwise output the image as-is. Args: image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor of shap
(image, seed=None)
| 325 | |
| 326 | @tf_export('image.random_flip_up_down') |
| 327 | def random_flip_up_down(image, seed=None): |
| 328 | """Randomly flips an image vertically (upside down). |
| 329 | |
| 330 | With a 1 in 2 chance, outputs the contents of `image` flipped along the first |
| 331 | dimension, which is `height`. Otherwise output the image as-is. |
| 332 | |
| 333 | Args: |
| 334 | image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor |
| 335 | of shape `[height, width, channels]`. |
| 336 | seed: A Python integer. Used to create a random seed. See |
| 337 | `tf.compat.v1.set_random_seed` for behavior. |
| 338 | |
| 339 | Returns: |
| 340 | A tensor of the same type and shape as `image`. |
| 341 | Raises: |
| 342 | ValueError: if the shape of `image` not supported. |
| 343 | """ |
| 344 | return _random_flip(image, 0, seed, 'random_flip_up_down') |
| 345 | |
| 346 | |
| 347 | @tf_export('image.random_flip_left_right') |
nothing calls this directly
no test coverage detected