def compute_threshold_jit(
    overlaps,
    gt_datas,
    dt_datas,
    ignored_gt,
    ignored_det,
    min_overlap,
    compute_fp=False,
):
    """Compute TP/FP statistics.
    Modified from https://github.com/sshaoehuai/PointRCNN/blob/master/tools/kitti_object_eval_python/eval.py
    """
    det_size = dt_datas.shape[0]
    gt_size = gt_datas.shape[0]
    dt_scores = dt_datas[:, -1]

    assigned_detection = [False] * det_size

    NO_DETECTION = np.finfo(np.float32).min
    tp, fp, fn = 0, 0, 0
    thresholds = np.zeros((gt_size, ))
    thresh_idx = 0

    for i in range(gt_size):
        if ignored_gt[i] == -1:
            continue
        det_idx = -1
        valid_detection = NO_DETECTION

        for j in range(det_size):
            if (ignored_det[j] == -1):
                continue
            if (assigned_detection[j]):
                continue
            overlap = overlaps[j, i]
            dt_score = dt_scores[j]

            # Not hit during TP/FP computation
            if (not compute_fp and (overlap > min_overlap) and dt_score > valid_detection):
                assert not compute_fp, "For sanity, compute_fp shoudl be False if we are here"
                det_idx = j
                valid_detection = dt_score

        # No matched prediction found, valid GT
        if (valid_detection == NO_DETECTION) and ignored_gt[i] == 0:
            fn += 1

        # Matched prediction, but NO valid GT or matched prediction is too small so we ignore it (NOT BECAUSE THE
        # CLASS IS WRONG)
        elif ((valid_detection != NO_DETECTION) and (ignored_gt[i] == 1 or ignored_det[det_idx] == 1)):
            assigned_detection[det_idx] = True

        # Matched prediction
        elif valid_detection != NO_DETECTION:
            tp += 1
            thresholds[thresh_idx] = dt_scores[det_idx]
            thresh_idx += 1

            assigned_detection[det_idx] = True

    return thresholds[:thresh_idx]
Compute TP/FP statistics.
    Modified from https://github.com/sshaoehuai/PointRCNN/blob/master/tools/kitti_object_eval_python/eval.py
    
tridet/evaluators/kitti_3d_evaluator.py