slim/preprocessing/vgg_preprocessing.py
def _smallest_size_at_least(height, width, smallest_side):
  """Computes new shape with the smallest side equal to `smallest_side`.

  Computes new shape with the smallest side equal to `smallest_side` while
  preserving the original aspect ratio.

  Args:
    height: an int32 scalar tensor indicating the current height.
    width: an int32 scalar tensor indicating the current width.
    smallest_side: A python integer or scalar `Tensor` indicating the size of
      the smallest side after resize.

  Returns:
    new_height: an int32 scalar tensor indicating the new height.
    new_width: and int32 scalar tensor indicating the new width.
  """
  smallest_side = tf.convert_to_tensor(value=smallest_side, dtype=tf.int32)

  height = tf.cast(height, dtype=tf.float32)
  width = tf.cast(width, dtype=tf.float32)
  smallest_side = tf.cast(smallest_side, dtype=tf.float32)

  scale = tf.cond(pred=tf.greater(height, width),
                  true_fn=lambda: smallest_side / width,
                  false_fn=lambda: smallest_side / height)
  new_height = tf.cast(height * scale, dtype=tf.int32)
  new_width = tf.cast(width * scale, dtype=tf.int32)
  return new_height, new_width
Computes new shape with the smallest side equal to `smallest_side`.

  Computes new shape with the smallest side equal to `smallest_side` while
  preserving the original aspect ratio.

  Args:
    height: an int32 scalar tensor indicating the current height.
    width: an int32 scalar tensor indicating the current width.
    smallest_side: A python integer or scalar `Tensor` indicating the size of
      the smallest side after resize.

  Returns:
    new_height: an int32 scalar tensor indicating the new height.
    new_width: and int32 scalar tensor indicating the new width.
  
Computes new shape with the smallest side equal to `smallest_side`.
Computes new shape with the smallest side equal to `smallest_side` while
preserving the original aspect ratio.
Computes new shape with the smallest side equal to ` smallest_side ` . Computes new shape with the smallest side equal to ` smallest_side ` while preserving the original aspect ratio .
def _smallest_size_at_least(height, width, smallest_side):
  smallest_side = tf.convert_to_tensor(value=smallest_side, dtype=tf.int32)
  height = tf.cast(height, dtype=tf.float32)
  width = tf.cast(width, dtype=tf.float32)
  smallest_side = tf.cast(smallest_side, dtype=tf.float32)
  scale = tf.cond(pred=tf.greater(height, width),
                  true_fn=lambda: smallest_side / width,
                  false_fn=lambda: smallest_side / height)
  new_height = tf.cast(height * scale, dtype=tf.int32)
  new_width = tf.cast(width * scale, dtype=tf.int32)
  return new_height, new_width
def _smallest_size_at_least ( height , width , smallest_side ) : smallest_side = tf . convert_to_tensor ( value = smallest_side , dtype = tf . int32 ) height = tf . cast ( height , dtype = tf . float32 ) width = tf . cast ( width , dtype = tf . float32 ) smallest_side = tf . cast ( smallest_side , dtype = tf . float32 ) scale = tf . cond ( pred = tf . greater ( height , width ) , true_fn = lambda : smallest_side / width , false_fn = lambda : smallest_side / height ) new_height = tf . cast ( height * scale , dtype = tf . int32 ) new_width = tf . cast ( width * scale , dtype = tf . int32 ) return new_height , new_width
Computes new shape with the smallest side equal to `smallest_side`.
Computes new shape with the smallest side equal to ` smallest_side ` .
"""Computes new shape with the smallest side equal to `smallest_side`.

  Computes new shape with the smallest side equal to `smallest_side` while
  preserving the original aspect ratio.

  Args:
    height: an int32 scalar tensor indicating the current height.
    width: an int32 scalar tensor indicating the current width.
    smallest_side: A python integer or scalar `Tensor` indicating the size of
      the smallest side after resize.

  Returns:
    new_height: an int32 scalar tensor indicating the new height.
    new_width: and int32 scalar tensor indicating the new width.
  """
an int32 scalar tensor indicating the new height.
new_width: and int32 scalar tensor indicating the new width.
an int32 scalar tensor indicating the new height . new_width : and int32 scalar tensor indicating the new width .
new_height
height
an int32 scalar tensor indicating the current height.
an int32 scalar tensor indicating the current height .
width
an int32 scalar tensor indicating the current width.
an int32 scalar tensor indicating the current width .
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 .