Resizes and pads an image to a target width and height.
tf.compat.v2.image.resize_with_pad( image, target_height, target_width, method=ResizeMethod.BILINEAR, antialias=False )
Resizes an image to a target width and height by keeping the aspect ratio the same without distortion. If the target dimensions don't match the image dimensions, the image is resized and then padded with zeroes to match requested dimensions.
| || 4-D Tensor of shape |
| ||Target height.|
| ||Target width.|
| || Method to use for resizing image. See |
| ||Whether to use anti-aliasing when resizing. See 'image.resize()'.|
| || if |
| Resized and padded image. If |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.