chainer.functions.resize_images

chainer.functions.resize_images(x, output_shape)[source]

Resize images to the given shape.

This function resizes 2D data to output_shape. Currently, only bilinear interpolation is supported as the sampling method.

Notatition: here is a notation for dimensionalities.

  • \(n\) is the batch size.

  • \(c_I\) is the number of the input channels.

  • \(h\) and \(w\) are the height and width of the input image, respectively.

  • \(h_O\) and \(w_O\) are the height and width of the output image.

Parameters
  • x (Variable or N-dimensional array) – Input variable of shape \((n, c_I, h, w)\).

  • output_shape (tuple) – This is a tuple of length 2 whose values are (h_O, w_O). Note that the order of height and width is opposite of the one in OpenCV.

Returns

Resized image whose shape is \((n, c_I, h_O, w_O)\).

Return type

Variable