def convert_bbox(
    coords: Sequence[float],
    img_size: Sequence[int],
    source: BBoxType,
    target: BBoxType,
) -> list[float]:
    """
    Convert the bounding box coordinates between different formats.

    Supported formats: "albumentations", "coco", "voc", "yolo".

    Albumentations format represents bounding boxes as [x_min, y_min, x_max, y_max],
    where:
        - (x_min, y_min) are the normalized coordinates of the top-left corner.
        - (x_max, y_max) are the normalized coordinates of the bottom-right corner.

    COCO format represents bounding boxes as [x_min, y_min, width, height], where:
        - (x_min, y_min) are the pixel coordinates of the top-left corner.
        - width and height define the size of the bounding box in pixels.

    PASCAL VOC format represents bounding boxes as [x_min, y_min, x_max, y_max], where:
        - (x_min, y_min) are the pixel coordinates of the top-left corner.
        - (x_max, y_max) are the pixel coordinates of the bottom-right corner.

    YOLO format represents bounding boxes as [x_center, y_center, width, height], where:
        - (x_center, y_center) are the normalized coordinates of the box center.
        - width and height normalized values define the size of the bounding box.

    Normalized coordinates are floats between 0 and 1, representing the
    relative position of the pixels in the image.

    Args:
        coords (Sequence[float]): The bounding box coordinates to convert.
        img_size (Sequence[int]): The reference image size (width, height).
        source (str): The source bounding box format.
        target (str): The target bounding box format.

    Returns:
        list[float]: The bounding box coordinates in the target format.
    """
    if source == "albumentations":
        return [
            round(c, 4) for c in convert_albumentations_bbox(coords, img_size, target)
        ]
    if source == "coco":
        return [round(c, 4) for c in convert_coco_bbox(coords, img_size, target)]
    if source == "voc":
        return [round(c, 4) for c in convert_voc_bbox(coords, img_size, target)]
    if source == "yolo":
        return [round(c, 4) for c in convert_yolo_bbox(coords, img_size, target)]
    raise ValueError(f"Unsupported source format: {source}")

    Convert the bounding box coordinates between different formats.

    Supported formats: "albumentations", "coco", "voc", "yolo".

    Albumentations format represents bounding boxes as [x_min, y_min, x_max, y_max],
    where:
        - (x_min, y_min) are the normalized coordinates of the top-left corner.
        - (x_max, y_max) are the normalized coordinates of the bottom-right corner.

    COCO format represents bounding boxes as [x_min, y_min, width, height], where:
        - (x_min, y_min) are the pixel coordinates of the top-left corner.
        - width and height define the size of the bounding box in pixels.

    PASCAL VOC format represents bounding boxes as [x_min, y_min, x_max, y_max], where:
        - (x_min, y_min) are the pixel coordinates of the top-left corner.
        - (x_max, y_max) are the pixel coordinates of the bottom-right corner.

    YOLO format represents bounding boxes as [x_center, y_center, width, height], where:
        - (x_center, y_center) are the normalized coordinates of the box center.
        - width and height normalized values define the size of the bounding box.

    Normalized coordinates are floats between 0 and 1, representing the
    relative position of the pixels in the image.

    Args:
        coords (Sequence[float]): The bounding box coordinates to convert.
        img_size (Sequence[int]): The reference image size (width, height).
        source (str): The source bounding box format.
        target (str): The target bounding box format.

    Returns:
        list[float]: The bounding box coordinates in the target format.
    
src/datachain/model/utils.py