def calc_is_correct_at_iou_th(gt_bboxes, pred_bboxes, iou_th, verbose=False):
    gt_bboxes = gt_bboxes.copy()
    pred_bboxes = pred_bboxes.copy()
    tp = 0
    fp = 0
    for (k, pred_bbox) in enumerate(pred_bboxes):
        if (len(gt_bboxes) == 0):
            fp += (len(pred_bboxes) - k)
            break
        ious = calc_iou(gt_bboxes, pred_bbox[None, 1:])
        max_iou = ious.max()
        if (max_iou >= iou_th):
            tp += 1
            gt_bboxes = np.delete(gt_bboxes, ious.argmax(), axis=0)
        else:
            fp += 1
    fn = len(gt_bboxes)
    return (tp, fp, fn)
def calc_is_correct_at_iou_th(gt_bboxes, pred_bboxes, iou_th, verbose=False):
    gt_bboxes = gt_bboxes.copy()
    pred_bboxes = pred_bboxes.copy()
    tp = 0
    fp = 0
    for (k, pred_bbox) in enumerate(pred_bboxes):
        if (len(gt_bboxes) == 0):
            fp += (len(pred_bboxes) - k)
            break
        ious = calc_iou(gt_bboxes, pred_bbox[None, 1:])
        max_iou = ious.max()
        if (max_iou >= iou_th):
            tp += 1
            gt_bboxes = np.delete(gt_bboxes, ious.argmax(), axis=0)
        else:
            fp += 1
    fn = len(gt_bboxes)
    return (tp, fp, fn)