def imresize(x, size=None, interp='<STR_LIT>', mode=None):
if size is None:<EOL><INDENT>size = [<NUM_LIT:100>, <NUM_LIT:100>]<EOL><DEDENT>if x.shape[-<NUM_LIT:1>] == <NUM_LIT:1>:<EOL><INDENT>x = scipy.misc.imresize(x[:, :, <NUM_LIT:0>], size, interp=interp, mode=mode)<EOL>return x[:, :, np.newaxis]<EOL><DEDENT>else:<EOL><INDENT>return scipy.misc.imresize(x, size, interp=interp, mode=mode)<EOL><DEDENT>
Resize an image by given output size and method.

    Warning, this function will rescale the value to [0, 255].

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    size : list of 2 int or None
        For height and width.
    interp : str
        Interpolation method for re-sizing (`nearest`, `lanczos`, `bilinear`, `bicubic` (default) or `cubic`).
    mode : str
        The PIL image mode (`P`, `L`, etc.) to convert image before resizing.

    Returns
    -------
    numpy.array
        A processed image.

    References
    ------------
    - `scipy.misc.imresize <https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.imresize.html>`__