(image, seed=None)
return fix_image_flip_shape(image, result)
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: A 3-D tensor of shape `[height, width, channels].`
    seed: A Python integer. Used to create a random seed. See
      @{tf.set_random_seed}
      for behavior.

  Returns:
    A 3-D tensor of the same type and shape as `image`.

  Raises:
    ValueError: if the shape of `image` not supported.
Randomly flips an image vertically (upside down).
Randomly flips an image vertically ( upside down ) .
def random_flip_up_down(image, seed=None):
  """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: A 3-D tensor of shape `[height, width, channels].`
    seed: A Python integer. Used to create a random seed. See
      @{tf.set_random_seed}
      for behavior.

  Returns:
    A 3-D tensor of the same type and shape as `image`.

  Raises:
    ValueError: if the shape of `image` not supported.
  """
  image = ops.convert_to_tensor(image, name='image')
  image = control_flow_ops.with_dependencies(
      _Check3DImage(image, require_static=False), image)
  uniform_random = random_ops.random_uniform([], 0, 1.0, seed=seed)
  mirror_cond = math_ops.less(uniform_random, .5)
  result = control_flow_ops.cond(mirror_cond,
                                 lambda: array_ops.reverse(image, [0]),
                                 lambda: image)
  return fix_image_flip_shape(image, result)
def random_flip_up_down ( image , seed = None ) : image = ops . convert_to_tensor ( image , name = 'image' ) image = control_flow_ops . with_dependencies ( _Check3DImage ( image , require_static = False ) , image ) uniform_random = random_ops . random_uniform ( [ ] , 0 , 1.0 , seed = seed ) mirror_cond = math_ops . less ( uniform_random , .5 ) result = control_flow_ops . cond ( mirror_cond , lambda : array_ops . reverse ( image , [ 0 ] ) , lambda : image ) return fix_image_flip_shape ( image , result )