src/transformers/models/oneformer/image_processing_oneformer.py/get_oneformer_resize_output_image_size
def get_oneformer_resize_output_image_size(
    image: np.ndarray,
    size: Union[int, Tuple[int, int], List[int], Tuple[int]],
    max_size: Optional[int] = None,
    default_to_square: bool = True,
) -> tuple:
    """
    Computes the output size given the desired size.

    Args:
        input_image (`np.ndarray`):
            The input image.
        size (`int`, `Tuple[int, int]`, `List[int]`, `Tuple[int]`):
            The size of the output image.
        default_to_square (`bool`, *optional*, defaults to `True`):
            Whether to default to square if no size is provided.
        max_size (`int`, *optional*):
            The maximum size of the output image.

    Returns:
        `Tuple[int, int]`: The output size.
    """
    output_size = get_resize_output_image_size(
        input_image=image, size=size, default_to_square=default_to_square, max_size=max_size
    )
    return output_size