open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.7k stars 9.48k forks source link

the question of voc_metric.py #12013

Open anzitong opened 1 month ago

anzitong commented 1 month ago
    elif self.metric == 'recall':
        gt_bboxes = [gt['bboxes'] for gt in gts]
        pr_bboxes = [pred[0] for pred in preds]
        recalls = eval_recalls(
            gt_bboxes,
            pr_bboxes,
            self.proposal_nums,
            self.iou_thrs,
            logger=logger,
            use_legacy_coordinate=True)
        for i, num in enumerate(self.proposal_nums):
            for j, iou_thr in enumerate(self.iou_thrs):
                eval_results[f'recall@{num}@{iou_thr}'] = recalls[i, j]
        if recalls.shape[1] > 1:
            ar = recalls.mean(axis=1)
            for i, num in enumerate(self.proposal_nums):
                eval_results[f'AR@{num}'] = ar[i]
    return eval_results

I wonder why pr_bboxes = [pred[0] for pred in preds] only takes the first value in the line of code?