def bbox_center(bbox, fmt="xyxy"):
    """
    fmt: xyxy or xywh
    -------
    return:
        x_ctr, y_ctr
    """
    if fmt == "xyxy":
        x1, y1, x2, y2 = bbox
        return 0.5 * (x1 + x2), 0.5 * (y1 + y2)
    elif fmt == "xywh":
        x1, y1, w, h = bbox
        return x1 + 0.5 * (w - 1), y1 + 0.5 * (h - 1)