def get_coordinates_from_bbox(bbox, coords_order):
    """
    This function is for reformatting bbox coordinates for downstream tasks
    Args:
        bbox: bounding box
        coords_order: coordinate order can be either 'xywh' or 'x1y1x2y2' format

    Returns:
        x1,y1,x2,y2
    """
    if coords_order == 'xywh':
        x1, y1, w, h = bbox
        x2, y2 = x1 + w, y1 + h
    elif coords_order == 'x1y1x2y2':
        x1, y1, x2, y2 = bbox
    else:
        raise ValueError("Please choose, coords_order from these 2 ['xywh', 'x1y1x2y2']")
    return x1, y1, x2, y2