slim/preprocessing/cifarnet_preprocessing.py
def preprocess_for_eval(image, output_height, output_width,
                        add_image_summaries=True):
  """Preprocesses the given image for evaluation.

  Args:
    image: A `Tensor` representing an image of arbitrary size.
    output_height: The height of the image after preprocessing.
    output_width: The width of the image after preprocessing.
    add_image_summaries: Enable image summaries.

  Returns:
    A preprocessed image.
  """
  if add_image_summaries:
    tf.compat.v1.summary.image('image', tf.expand_dims(image, 0))
  # Transform the image to floats.
  image = tf.cast(image, dtype=tf.float32)

  # Resize and crop if needed.
  resized_image = tf.image.resize_with_crop_or_pad(image,
                                                         output_width,
                                                         output_height)
  if add_image_summaries:
    tf.compat.v1.summary.image('resized_image', tf.expand_dims(resized_image, 0))

  # Subtract off the mean and divide by the variance of the pixels.
  return tf.image.per_image_standardization(resized_image)
Preprocesses the given image for evaluation.

  Args:
    image: A `Tensor` representing an image of arbitrary size.
    output_height: The height of the image after preprocessing.
    output_width: The width of the image after preprocessing.
    add_image_summaries: Enable image summaries.

  Returns:
    A preprocessed image.
  
Preprocesses the given image for evaluation.
Preprocesses the given image for evaluation .
def preprocess_for_eval(image, output_height, output_width,
                        add_image_summaries=True):
  if add_image_summaries:
    tf.compat.v1.summary.image('image', tf.expand_dims(image, 0))
  image = tf.cast(image, dtype=tf.float32)
  resized_image = tf.image.resize_with_crop_or_pad(image,
                                                         output_width,
                                                         output_height)
  if add_image_summaries:
    tf.compat.v1.summary.image('resized_image', tf.expand_dims(resized_image, 0))
  return tf.image.per_image_standardization(resized_image)
def preprocess_for_eval ( image , output_height , output_width , add_image_summaries = True ) : if add_image_summaries : tf . compat . v1 . summary . image ( 'image' , tf . expand_dims ( image , 0 ) ) image = tf . cast ( image , dtype = tf . float32 ) resized_image = tf . image . resize_with_crop_or_pad ( image , output_width , output_height ) if add_image_summaries : tf . compat . v1 . summary . image ( 'resized_image' , tf . expand_dims ( resized_image , 0 ) ) return tf . image . per_image_standardization ( resized_image )
Preprocesses the given image for evaluation.
Preprocesses the given image for evaluation .
"""Preprocesses the given image for evaluation.

  Args:
    image: A `Tensor` representing an image of arbitrary size.
    output_height: The height of the image after preprocessing.
    output_width: The width of the image after preprocessing.
    add_image_summaries: Enable image summaries.

  Returns:
    A preprocessed image.
  """ # Transform the image to floats. # Resize and crop if needed. # Subtract off the mean and divide by the variance of the pixels.
A preprocessed image.
A preprocessed image .
image
A `Tensor` representing an image of arbitrary size.
A ` Tensor ` representing an image of arbitrary size .
output_height
The height of the image after preprocessing.
The height of the image after preprocessing .
output_width
The width of the image after preprocessing.
The width of the image after preprocessing .
add_image_summaries
Enable image summaries.
Enable image summaries .