(image, size,
                 method=tf.image.ResizeMethod.BILINEAR,
                 align_corners=False)
Resize an image and bounding boxes.
Resize an image and bounding boxes.
Resize an image and bounding boxes .
def resize_image(image, size,
                 method=tf.image.ResizeMethod.BILINEAR,
                 align_corners=False):
    """Resize an image and bounding boxes.
    """
    # Resize image.
    with tf.name_scope('resize_image'):
        height, width, channels = _ImageDimensions(image)
        image = tf.expand_dims(image, 0)
        image = tf.image.resize_images(image, size,
                                       method, align_corners)
        image = tf.reshape(image, tf.stack([size[0], size[1], channels]))
        return image
def resize_image ( image , size , method = tf . image . ResizeMethod . BILINEAR , align_corners = False ) : # Resize image. with tf . name_scope ( 'resize_image' ) : height , width , channels = _ImageDimensions ( image ) image = tf . expand_dims ( image , 0 ) image = tf . image . resize_images ( image , size , method , align_corners ) image = tf . reshape ( image , tf . stack ( [ size [ 0 ] , size [ 1 ] , channels ] ) ) return image