def get_image_height_and_width(image_size: int | Sequence[int]) -> tuple[int, int]:
    """Get height and width from image size parameter.

    Args:
        image_size (int | Sequence[int]): Single int for square, or (H,W) sequence

    Returns:
        tuple[int, int]: Image height and width

    Raises:
        TypeError: If image_size is not int or sequence of ints

    Examples:
        >>> get_image_height_and_width(256)
        (256, 256)

        >>> get_image_height_and_width((480, 640))
        (480, 640)

        >>> get_image_height_and_width(256.0)
        Traceback (most recent call last):
            ...
        TypeError: ``image_size`` could be either int or tuple[int, int]
    """
    if isinstance(image_size, int):
        height_and_width = (image_size, image_size)
    elif isinstance(image_size, Sequence):
        height_and_width = int(image_size[0]), int(image_size[1])
    else:
        msg = "``image_size`` could be either int or tuple[int, int]"
        raise TypeError(msg)

    return height_and_width
Get height and width from image size parameter.

    Args:
        image_size (int | Sequence[int]): Single int for square, or (H,W) sequence

    Returns:
        tuple[int, int]: Image height and width

    Raises:
        TypeError: If image_size is not int or sequence of ints

    Examples:
        >>> get_image_height_and_width(256)
        (256, 256)

        >>> get_image_height_and_width((480, 640))
        (480, 640)

        >>> get_image_height_and_width(256.0)
        Traceback (most recent call last):
            ...
        TypeError: ``image_size`` could be either int or tuple[int, int]
    
src/anomalib/data/utils/image.py