def convert_bounding_boxes(bboxes):
    """Accepts a list of bounding boxes in format (xmin,ymin,xmax,ymax)
    Returns the list of boxes in coco format (xmin,ymin, width, height)
    """
    coco_boxes = []
    all_tokens = []
    for b, tokens in bboxes:
        ymin, ymax, xmin, xmax = b
        h = ymax - ymin
        w = xmax - xmin
        coco_boxes.append([xmin, ymin, w, h])
        all_tokens.append(tokens)

    assert len(coco_boxes) == len(all_tokens)
    return coco_boxes, all_tokens