tf.compat.v1.image.resize

View source on GitHub

Resize images to size using the specified method.

tf.compat.v1.image.resize(
    images, size, method=ResizeMethodV1.BILINEAR, align_corners=False,
    preserve_aspect_ratio=False, name=None
)

Resized images will be distorted if their original aspect ratio is not the same as size. To avoid distortions see tf.compat.v1.image.resize_image_with_pad.

method can be one of:

The return value has the same type as images if method is ResizeMethod.NEAREST_NEIGHBOR. It will also have the same type as images if the size of images can be statically determined to be the same as size, because images is returned in this case. Otherwise, the return value has type float32.

Args:

Raises:

Returns:

If images was 4-D, a 4-D float Tensor of shape [batch, new_height, new_width, channels]. If images was 3-D, a 3-D float Tensor of shape [new_height, new_width, channels].