def imresize(img, size, return_scale=False, interpolation='<STR_LIT>'):
h, w = img.shape[:<NUM_LIT:2>]<EOL>resized_img = cv2.resize(<EOL>img, size, interpolation=interp_codes[interpolation])<EOL>if not return_scale:<EOL><INDENT>return resized_img<EOL><DEDENT>else:<EOL><INDENT>w_scale = size[<NUM_LIT:0>] / w<EOL>h_scale = size[<NUM_LIT:1>] / h<EOL>return resized_img, w_scale, h_scale<EOL><DEDENT>
Resize image to a given size.

    Args:
        img (ndarray): The input image.
        size (tuple): Target (w, h).
        return_scale (bool): Whether to return `w_scale` and `h_scale`.
        interpolation (str): Interpolation method, accepted values are
            "nearest", "bilinear", "bicubic", "area", "lanczos".

    Returns:
        tuple or ndarray: (`resized_img`, `w_scale`, `h_scale`) or
            `resized_img`.