def compute_rotation_angle(polygon: List[List[int]]) -> float:
    """
    Compute the rotation angle of the minimum bounding box that fits around a given polygon.

    Args:
        polygon (List[List[int]]): List of polygon vertices represented as coordinate pairs.

    Returns:
        float: The rotation angle in degrees.
    """
    # Create a copy of the polygon in the format expected by OpenCV
    points = np.array(polygon, dtype=np.int32)

    # Fit a rotated rectangle around the polygon
    rect = cv2.minAreaRect(points)

    # Get the rotation angle of the minimum bounding box
    rotation_angle = rect[2]

    return rotation_angle

    Compute the rotation angle of the minimum bounding box that fits around a given polygon.

    Args:
        polygon (List[List[int]]): List of polygon vertices represented as coordinate pairs.

    Returns:
        float: The rotation angle in degrees.
    
scripts/easyphoto_utils/tryon_utils.py