def METHOD_NAME(img, dims=None, need_transpose=False):
    img = maybe_resize(img, dims)
    mean = np.array([0.485, 0.456, 0.406], dtype=np.float32)
    std = np.array([0.229, 0.224, 0.225], dtype=np.float32)
    img = img / 255. - mean
    img = img / std
    if need_transpose:
        img = img.transpose([2, 0, 1])
    return img