1
- import json
2
1
import os
3
- from typing import Dict , List , Optional , Tuple
2
+ from typing import Dict , List , Optional
4
3
5
4
import numpy as np
6
5
from nuscenes .eval .common .data_classes import EvalBox , EvalBoxes
7
- from nuscenes .eval .common .loaders import load_prediction
8
6
from nuscenes .eval .common .utils import center_distance
9
7
from nuscenes .eval .detection .data_classes import DetectionBox
10
8
from nuscenes .eval .detection .evaluate import DetectionEval as _DetectionEval
@@ -57,8 +55,8 @@ def __init__(
57
55
mean_ap_weight : int ,
58
56
):
59
57
60
- # assert set(class_range.keys()) == set(DETECTION_NAMES), "Class count mismatch."
61
- assert dist_th_tp in dist_ths , 'dist_th_tp must be in set of dist_ths.'
58
+ assert dist_th_tp in dist_ths , \
59
+ 'dist_th_tp must be in set of dist_ths.'
62
60
63
61
self .class_range = class_range
64
62
self .dist_fcn = dist_fcn
@@ -122,15 +120,19 @@ class nuScenesDetectionEval(_DetectionEval):
122
120
written to the provided output_dir. nuScenes uses the following detection
123
121
metrics:
124
122
125
- - Mean Average Precision (mAP): Uses center-distance as matching criterion; averaged over distance thresholds.
126
- - True Positive (TP) metrics: Average of translation, velocity, scale, orientation and attribute errors.
123
+ - Mean Average Precision (mAP): Uses center-distance as matching criterion;
124
+ averaged over distance thresholds.
125
+ - True Positive (TP) metrics: Average of translation, velocity, scale,
126
+ orientation and attribute errors.
127
127
- nuScenes Detection Score (NDS): The weighted sum of the above.
128
128
Here is an overview of the functions in this method:
129
- - init: Loads GT annotations and predictions stored in JSON format and filters the boxes.
129
+ - init: Loads GT annotations and predictions stored in
130
+ JSON format and filters the boxes.
130
131
- run: Performs evaluation and dumps the metric data to disk.
131
132
- render: Renders various plots and dumps to disk.
132
133
We assume that:
133
- - Every sample_token is given in the results, although there may be not predictions for that sample.
134
+ - Every sample_token is given in the results, although there may be
135
+ not predictions for that sample.
134
136
Please see https://www.nuscenes.org/object-detection for more details.
135
137
"""
136
138
@@ -149,7 +151,8 @@ def __init__(
149
151
:param config: A DetectionConfig object.
150
152
:param result_boxes: result bounding boxes.
151
153
:param gt_boxes: ground-truth bounding boxes.
152
- :param eval_set: The dataset split to evaluate on, e.g. train, val or test.
154
+ :param eval_set: The dataset split to evaluate on,
155
+ e.g. train, val or test.
153
156
:param output_dir: Folder to save plots and results to.
154
157
:param verbose: Whether to print to stdout.
155
158
"""
0 commit comments