def METHOD_NAME(i: np.ndarray) -> np.ndarray:
    ic = get_h_w_c(i)[2]
    if ic == 3:
        i = cv2.cvtColor(i, cv2.COLOR_BGR2RGB)
    elif ic == 4:
        i = cv2.cvtColor(i, cv2.COLOR_BGRA2RGBA)
    i = upscale_impl(
        i,
        model,
        model.model.layers[0].outputs[0],
        model.model.layers[-1].outputs[0],
        tile_size,
    )
    if ic == 3:
        i = cv2.cvtColor(i, cv2.COLOR_RGB2BGR)
    elif ic == 4:
        i = cv2.cvtColor(i, cv2.COLOR_RGBA2BGRA)
    return i