(image_file)
Loads an image as a numpy array.

  Args:
    image_file: str. Image file.

  Returns:
    A 3-D numpy array of shape [image_size, image_size, 3] and dtype uint8,
    with values in [0, 255].
Loads an image as a numpy array.
Loads an image as a numpy array .
def load_np_image_uint8(image_file):
  """Loads an image as a numpy array.

  Args:
    image_file: str. Image file.

  Returns:
    A 3-D numpy array of shape [image_size, image_size, 3] and dtype uint8,
    with values in [0, 255].
  """
  with tempfile.NamedTemporaryFile() as f:
    f.write(tf.gfile.GFile(image_file, 'rb').read())
    f.flush()
    image = skimage.io.imread(f.name)
    # Workaround for black-and-white images
    if image.ndim == 2:
      image = np.tile(image[:, :, None], (1, 1, 3))
    return image
def load_np_image_uint8 ( image_file ) : with tempfile . NamedTemporaryFile ( ) as f : f . write ( tf . gfile . GFile ( image_file , 'rb' ) . read ( ) ) f . flush ( ) image = skimage . io . imread ( f . name ) # Workaround for black-and-white images if image . ndim == 2 : image = np . tile ( image [ : , : , None ] , ( 1 , 1 , 3 ) ) return image