Skip to content

Commit

Permalink
fix the eval script
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCMax committed Mar 20, 2024
1 parent 007bfe2 commit 41c91a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/cal_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ def parse_args():
parser = argparse.ArgumentParser(
description='MMDet3D test (and eval) a model')
parser.add_argument('results_file', help='the results json file')
parser.add_argument('anno_file', help='annoations json file')
parser.add_argument('ann_file', help='annoations json file')

parser.add_argument('--iou_thr',
type=list,
default=[0.25, 0.5],
help='the IoU threshold during evaluation')

args = parser.parse_args()
return args

def ground_eval(gt_annos, det_annos, iou_thr):

Expand Down Expand Up @@ -52,10 +54,9 @@ def ground_eval(gt_annos, det_annos, iou_thr):
hard = gt_anno['is_hard']
unique = gt_anno['is_unique']

box_index = scores.argsort(dim=-1, descending=True)[:10]
top_bbox = bboxes[box_index]
top_bboxes = bboxes[:10]

iou = top_bbox.overlaps(top_bbox, gt_bboxes) # (num_query, 1)
iou = top_bboxes.overlaps(top_bboxes, gt_bboxes) # (num_query, 1)

for t in iou_thr:
threshold = iou > t
Expand Down

0 comments on commit 41c91a9

Please sign in to comment.