MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / random_flip_up_down

Function random_flip_up_down

tensorflow/python/ops/image_ops_impl.py:327–344  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

325
326@tf_export('image.random_flip_up_down')
327def 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')

Callers

nothing calls this directly

Calls 1

_random_flipFunction · 0.85

Tested by

no test coverage detected