def preprocess_for_eval(image, height, width, central_fraction=0.875, scope=None):
 with tf.name_scope(scope, 'eval_image', [image, height, width]):
  if (image.dtype != tf.float32):
   image = tf.image.convert_image_dtype(image, dtype=tf.float32)
  if central_fraction:
   image = tf.image.central_crop(image, central_fraction=central_fraction)
  if (height and width):
   image = tf.expand_dims(image, 0)
   image = tf.image.resize_bilinear(image, [height, width], align_corners=False)
   image = tf.squeeze(image, [0])
  image = tf.sub(image, 0.5)
  image = tf.mul(image, 2.0)
  return image

def preprocess_for_eval ( image , height , width , central_fraction = 0.875 , scope = None ) : with tf . name_scope ( scope , 'eval_image' , [ image , height , width ] ) : if ( image . dtype != tf . float32 ) : image = tf . image . convert_image_dtype ( image , dtype = tf . float32 ) if central_fraction : image = tf . image . central_crop ( image , central_fraction = central_fraction ) if ( height and width ) : image = tf . expand_dims ( image , 0 ) image = tf . image . resize_bilinear ( image , [ height , width ] , align_corners = False ) image = tf . squeeze ( image , [ 0 ] ) image = tf . sub ( image , 0.5 ) image = tf . mul ( image , 2.0 ) return image
prepare one image for evaluation .