def eval_cifar10_image(image, height, width, scope=None):
"""Prepare one image for evaluation.
Args:
image: 3-D float Tensor
height: integer
width: integer
scope: Optional scope for op_scope.
Returns:
3-D float Tensor of prepared image.
"""
with tf.name_scope(scope, 'eval_image', [image, height, width]):
# Image processing for evaluation.
# Crop the central [height, width] of the image.
image = tf.image.resize_image_with_crop_or_pad(image, height, width)
# Subtract off the mean and divide by the variance of the pixels.
image = tf.image.per_image_standardization(image)
image.set_shape([height, width, 3])
return image
评论列表
文章目录