(images, rot90_scalars=(0, 1, 2, 3))
return results
Return the input image and its 90, 180, and 270 degree rotations.
Return the input image and its 90, 180, and 270 degree rotations.
Return the input image and its 90 180 and 270 degree rotations .
def rotate_images(images, rot90_scalars=(0, 1, 2, 3)):
  """Return the input image and its 90, 180, and 270 degree rotations."""
  images_rotated = [
      images,  # 0 degree
      tf.image.flip_up_down(tf.image.transpose_image(images)),  # 90 degrees
      tf.image.flip_left_right(tf.image.flip_up_down(images)),  # 180 degrees
      tf.image.transpose_image(tf.image.flip_up_down(images))  # 270 degrees
  ]

  results = tf.stack([images_rotated[i] for i in rot90_scalars])
  results = tf.reshape(results,
                       [-1] + images.get_shape().as_list()[1:])
  return results
def rotate_images ( images , rot90_scalars = ( 0 , 1 , 2 , 3 ) ) : images_rotated = [ images , # 0 degree tf . image . flip_up_down ( tf . image . transpose_image ( images ) ) , # 90 degrees tf . image . flip_left_right ( tf . image . flip_up_down ( images ) ) , # 180 degrees tf . image . transpose_image ( tf . image . flip_up_down ( images ) ) # 270 degrees ] results = tf . stack ( [ images_rotated [ i ] for i in rot90_scalars ] ) results = tf . reshape ( results , [ - 1 ] + images . get_shape ( ) . as_list ( ) [ 1 : ] ) return results