from typing import List


def convert_xyxy_to_bounding_box(box: List) -> dict:
    """
    Converts a list of xy coordinates representing a bounding box into a dictionary

    Parameters
    ----------
    box: list
        List of arrays of coordinates in the format [x1, y1, x2, y2]

    Returns
    -------
    bounding_box: dict
        Bounding box in the format {x: x1, y: y1, h: height, w: width}
    """
    if not isinstance(box[0], (int, float)):
        raise ValueError("Unknown input format")

    x1, y1, x2, y2 = box
    width = x2 - x1
    height = y2 - y1
    return {"x": x1, "y": y1, "w": width, "h": height}