slim/preprocessing/vgg_preprocessing.py
def _aspect_preserving_resize(image, smallest_side):
  """Resize images preserving the original aspect ratio.

  Args:
    image: A 3-D image `Tensor`.
    smallest_side: A python integer or scalar `Tensor` indicating the size of
      the smallest side after resize.

  Returns:
    resized_image: A 3-D tensor containing the resized image.
  """
  smallest_side = tf.convert_to_tensor(value=smallest_side, dtype=tf.int32)

  shape = tf.shape(input=image)
  height = shape[0]
  width = shape[1]
  new_height, new_width = _smallest_size_at_least(height, width, smallest_side)
  image = tf.expand_dims(image, 0)
  resized_image = tf.image.resize(image, [new_height, new_width],
                                           method=tf.image.ResizeMethod.BILINEAR)
  resized_image = tf.squeeze(resized_image)
  resized_image.set_shape([None, None, 3])
  return resized_image
Resize images preserving the original aspect ratio.

  Args:
    image: A 3-D image `Tensor`.
    smallest_side: A python integer or scalar `Tensor` indicating the size of
      the smallest side after resize.

  Returns:
    resized_image: A 3-D tensor containing the resized image.
  
Resize images preserving the original aspect ratio.
Resize images preserving the original aspect ratio .
def _aspect_preserving_resize(image, smallest_side):
  smallest_side = tf.convert_to_tensor(value=smallest_side, dtype=tf.int32)
  shape = tf.shape(input=image)
  height = shape[0]
  width = shape[1]
  new_height, new_width = _smallest_size_at_least(height, width, smallest_side)
  image = tf.expand_dims(image, 0)
  resized_image = tf.image.resize(image, [new_height, new_width],
                                           method=tf.image.ResizeMethod.BILINEAR)
  resized_image = tf.squeeze(resized_image)
  resized_image.set_shape([None, None, 3])
  return resized_image
def _aspect_preserving_resize ( image , smallest_side ) : smallest_side = tf . convert_to_tensor ( value = smallest_side , dtype = tf . int32 ) shape = tf . shape ( input = image ) height = shape [ 0 ] width = shape [ 1 ] new_height , new_width = _smallest_size_at_least ( height , width , smallest_side ) image = tf . expand_dims ( image , 0 ) resized_image = tf . image . resize ( image , [ new_height , new_width ] , method = tf . image . ResizeMethod . BILINEAR ) resized_image = tf . squeeze ( resized_image ) resized_image . set_shape ( [ None , None , 3 ] ) return resized_image
Resize images preserving the original aspect ratio.
Resize images preserving the original aspect ratio .
"""Resize images preserving the original aspect ratio.

  Args:
    image: A 3-D image `Tensor`.
    smallest_side: A python integer or scalar `Tensor` indicating the size of
      the smallest side after resize.

  Returns:
    resized_image: A 3-D tensor containing the resized image.
  """
A 3-D tensor containing the resized image.
A 3 - D tensor containing the resized image .
resized_image
image
A 3-D image `Tensor`.
A 3 - D image ` Tensor ` .
smallest_side
A python integer or scalar `Tensor` indicating the size of
the smallest side after resize.
A python integer or scalar ` Tensor ` indicating the size of the smallest side after resize .