def eval_one(results, gts, point_dis=False, rect_label=None):
    '\n  :param results:\n  :param gts:\n  :param point_dis:\n  :param rect_label: use rectangle or not\n  :return right_num, error_num, mid_num\n  '
    m = len(gts)
    is_used = ([False] * m)
    right_num = 0
    err_num = 0
    mid_num = 0
    for res in results:
        if (not point_dis):
            max_iou = (- 1)
            max_index = (- 1)
            for (j, gt) in enumerate(gts):
                if is_used[j]:
                    continue
                iou = calculate_iou(res, gt)
                if (max_iou < iou):
                    max_iou = iou
                    max_index = j
            if (max_iou > th):
                is_used[max_index] = True
                if (rect_label == None):
                    right_num += 1
                elif rect_label[max_index]:
                    right_num += 1
                elif (not rect_label[max_index]):
                    mid_num += 1
            else:
                err_num += 1
        else:
            flag = False
            for (j, gt) in enumerate(gts):
                if is_used[j]:
                    continue
                if verify_point_distance(res, gt):
                    is_used[j] = True
                    right_num += 1
                    flag = True
                    break
            if (not flag):
                err_num += 1
    assert (right_num <= m)
    assert (err_num <= len(results))
    return (right_num, err_num, mid_num)
:param results:
:param gts:
:param point_dis:
:param rect_label: use rectangle or not
:return right_num, error_num, mid_num
def eval_one(results, gts, point_dis=False, rect_label=None):
    '\n  :param results:\n  :param gts:\n  :param point_dis:\n  :param rect_label: use rectangle or not\n  :return right_num, error_num, mid_num\n  '
    m = len(gts)
    is_used = ([False] * m)
    right_num = 0
    err_num = 0
    mid_num = 0
    for res in results:
        if (not point_dis):
            max_iou = (- 1)
            max_index = (- 1)
            for (j, gt) in enumerate(gts):
                if is_used[j]:
                    continue
                iou = calculate_iou(res, gt)
                if (max_iou < iou):
                    max_iou = iou
                    max_index = j
            if (max_iou > th):
                is_used[max_index] = True
                if (rect_label == None):
                    right_num += 1
                elif rect_label[max_index]:
                    right_num += 1
                elif (not rect_label[max_index]):
                    mid_num += 1
            else:
                err_num += 1
        else:
            flag = False
            for (j, gt) in enumerate(gts):
                if is_used[j]:
                    continue
                if verify_point_distance(res, gt):
                    is_used[j] = True
                    right_num += 1
                    flag = True
                    break
            if (not flag):
                err_num += 1
    assert (right_num <= m)
    assert (err_num <= len(results))
    return (right_num, err_num, mid_num)