def xyxy2xywh(box):
    """
    Convert bounding box from xyxy to xywh format
    :param box: array-like, contains (x1, y1, x2, y2)
    """
    x1, y1, x2, y2 = box
    w, h = x2 - x1, y2 - y1
    x_c = x1 + w / 2
    y_c = y1 + h / 2
    return x_c, y_c, w, h