def img_denormalize(img, img_mean, img_std, img_mode='rgb'):
    """
    De-normalize the image array by multiply `img_std` and add the `img_mean`
    in the right image mode, the mean and std should correspond to `img_mode`

    Args:
        img (ndarray): Image array to be normalized.
        img_mean (tuple[float]): mean value for each channel of image.
        img_std (tuple[float]): std value for each channel of image.
        img_mode (str): `rgb` or `bgr`, to specify the img mode.

    Returns:
        normed_img (ndarray): de-normalized image array.
    """
    assert img_mode in ['rgb', 'bgr'], "image mode must be 'rgb' or 'bgr'."
    return img * img_std + img_mean