tf.image.resize_images(images, size, method=0, align_corners=False)
Resize images to size using the specified method.
Resized images will be distorted if their original aspect ratio is not the same as size. To avoid distortions see resize_image_with_crop_or_pad.
method can be one of:
-
ResizeMethod.BILINEAR: Bilinear interpolation. -
ResizeMethod.NEAREST_NEIGHBOR: Nearest neighbor interpolation. -
ResizeMethod.BICUBIC: Bicubic interpolation. -
ResizeMethod.AREA: Area interpolation.
Args:
-
images: 4-D Tensor of shape[batch, height, width, channels]or 3-D Tensor of shape[height, width, channels]. -
size: A 1-D int32 Tensor of 2 elements:new_height, new_width. The new size for the images. -
method: ResizeMethod. Defaults toResizeMethod.BILINEAR. -
align_corners: bool. If true, exactly align all 4 corners of the input and output. Defaults tofalse.
Raises:
-
ValueError: if the shape ofimagesis incompatible with the shape arguments to this function -
ValueError: ifsizehas invalid shape or type. -
ValueError: if an unsupported resize method is specified.
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].
Please login to continue.