image_resize_short

paddle.fluid.layers.nn. image_resize_short ( input, out_short_len, resample='BILINEAR' ) [source]

This op resizes a batch of images. The short edge of input images will be resized to the given ‘out_short_len’. The long edge of input images will be resized proportionately to make images’ length-width ratio constant.

Parameters
  • input (Variable) – 4-D tensor(NCHW), The input tensor of image resize layer.

  • out_short_len (int) – The length of output images’ short edge.

  • resample (str) – resample method, default: BILINEAR.

Returns

4-D tensor(NCHW).

Return type

Variable

Examples

import paddle.fluid as fluid
input = fluid.data(name="input", shape=[None,3,6,9], dtype="float32")
out = fluid.layers.image_resize_short(input, out_short_len=3)