def METHOD_NAME(
    labels: np.ndarray, pred_probs: np.ndarray, factor: int = 1
) -> Tuple[np.ndarray, np.ndarray]:
    if factor == 1:
        return labels, pred_probs
    num_image, num_classes, h, w = pred_probs.shape
    # Check if possible to downsample
    if h % downsample != 0 or w % downsample != 0:
        raise ValueError(
            f"Height {h} and width {w} not divisible by downsample value of {downsample}. Set kwarg downsample to 1 to avoid downsampling."
        )
    small_labels = np.round(
        labels.reshape((num_image, h // factor, factor, w // factor, factor)).mean(4).mean(2)
    )
    small_pred_probs = (
        pred_probs.reshape((num_image, num_classes, h // factor, factor, w // factor, factor))
        .mean(5)
        .mean(3)
    )
    # We want to make sure that pred_probs are renormalized
    row_sums = small_pred_probs.sum(axis=1)
    renorm_small_pred_probs = small_pred_probs / np.expand_dims(row_sums, 1)
    return small_labels, renorm_small_pred_probs