CHANNELS = 3
HEIGHT = 200
WIDTH = 200
images_placeholder = tf.placeholder(dtype=tf.string, shape=(None,))

def decode_and_resize(image_str_tensor):
    """Decodes jpeg string, resizes it and returns a uint8 tensor."""
image = tf.image.decode_jpeg(image_str_tensor, channels=CHANNELS)
image = tf.expand_dims(image, 0)
image = tf.image.resize_bilinear(image, [HEIGHT, WIDTH], align_corners=False)
image = tf.squeeze(image, squeeze_dims=[0])
image = tf.cast(image, dtype=tf.uint8)
return image
decoded_images = tf.map_fn(decode_and_resize, images_placeholder, back_prop
    =False, dtype=tf.uint8)
images = tf.image.convert_image_dtype(decoded_images, dtype=tf.float32)
images = tf.sub(images, 0.5)
images = tf.mul(images, 2.0)
How convert a jpeg image into json file in Google machine learning