def calc_f2_score(gt_bboxes_list, pred_bboxes_list, verbose=False):
    '\n    gt_bboxes_list: list of (N, 4) np.array in xywh format\n    pred_bboxes_list: list of (N, 5) np.array in conf+xywh format\n    '
    f2_dict = {'f2': 0, 'P': 0, 'R': 0}
    all_tps = [list(([0] * 11)) for _ in range(len(gt_bboxes_list))]
    all_fps = [list(([0] * 11)) for _ in range(len(gt_bboxes_list))]
    all_fns = [list(([0] * 11)) for _ in range(len(gt_bboxes_list))]
    for (k, iou_th) in enumerate(np.arange(0.3, 0.85, 0.05)):
        (tps, fps, fns) = (0, 0, 0)
        for (i, (gt_bboxes, pred_bboxes)) in enumerate(zip(gt_bboxes_list, pred_bboxes_list)):
            (tp, fp, fn) = calc_is_correct(gt_bboxes, pred_bboxes, iou_th)
            tps += tp
            fps += fp
            fns += fn
            all_tps[i][k] = tp
            all_fps[i][k] = fp
            all_fns[i][k] = fn
            if verbose:
                num_gt = len(gt_bboxes)
                num_pred = len(pred_bboxes)
                print(f'num_gt:{num_gt:<3} num_pred:{num_pred:<3} tp:{tp:<3} fp:{fp:<3} fn:{fn:<3}')
        f2 = f_beta(tps, fps, fns, beta=2)
        precision = f_beta(tps, fps, fns, beta=0)
        recall = f_beta(tps, fps, fns, beta=100)
        f2_dict[('f2_' + str(round(iou_th, 3)))] = f2
        f2_dict[('P_' + str(round(iou_th, 3)))] = precision
        f2_dict[('R_' + str(round(iou_th, 3)))] = recall
        f2_dict['f2'] += (f2 / 11)
        f2_dict['P'] += (precision / 11)
        f2_dict['R'] += (recall / 11)
    f2_dict['tps'] = all_tps
    f2_dict['fps'] = all_fps
    f2_dict['fns'] = all_fns
    return f2_dict
gt_bboxes_list: list of (N, 4) np.array in xywh format
pred_bboxes_list: list of (N, 5) np.array in conf+xywh format
def calc_f2_score(gt_bboxes_list, pred_bboxes_list, verbose=False):
    '\n    gt_bboxes_list: list of (N, 4) np.array in xywh format\n    pred_bboxes_list: list of (N, 5) np.array in conf+xywh format\n    '
    f2_dict = {'f2': 0, 'P': 0, 'R': 0}
    all_tps = [list(([0] * 11)) for _ in range(len(gt_bboxes_list))]
    all_fps = [list(([0] * 11)) for _ in range(len(gt_bboxes_list))]
    all_fns = [list(([0] * 11)) for _ in range(len(gt_bboxes_list))]
    for (k, iou_th) in enumerate(np.arange(0.3, 0.85, 0.05)):
        (tps, fps, fns) = (0, 0, 0)
        for (i, (gt_bboxes, pred_bboxes)) in enumerate(zip(gt_bboxes_list, pred_bboxes_list)):
            (tp, fp, fn) = calc_is_correct(gt_bboxes, pred_bboxes, iou_th)
            tps += tp
            fps += fp
            fns += fn
            all_tps[i][k] = tp
            all_fps[i][k] = fp
            all_fns[i][k] = fn
            if verbose:
                num_gt = len(gt_bboxes)
                num_pred = len(pred_bboxes)
                print(f'num_gt:{num_gt:<3} num_pred:{num_pred:<3} tp:{tp:<3} fp:{fp:<3} fn:{fn:<3}')
        f2 = f_beta(tps, fps, fns, beta=2)
        precision = f_beta(tps, fps, fns, beta=0)
        recall = f_beta(tps, fps, fns, beta=100)
        f2_dict[('f2_' + str(round(iou_th, 3)))] = f2
        f2_dict[('P_' + str(round(iou_th, 3)))] = precision
        f2_dict[('R_' + str(round(iou_th, 3)))] = recall
        f2_dict['f2'] += (f2 / 11)
        f2_dict['P'] += (precision / 11)
        f2_dict['R'] += (recall / 11)
    f2_dict['tps'] = all_tps
    f2_dict['fps'] = all_fps
    f2_dict['fns'] = all_fns
    return f2_dict