py123detection.mmcv_plugin.evaluation

nuScenes-style detection evaluation against the ground truth stored in an exported pickle.

mmdetection3d’s NuScenesDataset.evaluate hands predictions to the devkit’s NuScenesEval, which reads ground truth from the nuScenes database and requires an official split. Here the devkit’s EvalBoxes are built from data_infos instead and its metric code (accumulate / calc_ap / calc_tp) runs on them, so any dataset can be evaluated as long as its class names are nuScenes detection names (DetectionBox asserts that).

Ground truth goes through the same path as predictions (LiDARInstance3DBoxes -> output_to_nusc_box -> lidar_nusc_box_to_global), so a box layout mismatch cannot skew the metric.

Differences from the official protocol:

  • add_center_dist uses the frame’s ego2global_translation instead of the LIDAR_TOP ego pose record, the same quantity read from the pickle;

  • no bike-rack filter, since there is no static_object.bicycle_rack to look up;

  • exports carry no attributes, so attr_err is nan per box and the devkit scores it as 1.0, as in CoIn3D’s Lyft / Waymo tables. NDS includes that fixed penalty.

Functions

build_detection_config(class_names[, ...])

A devkit DetectionConfig restricted to class_names.

evaluate_from_infos(result_path, data_infos, ...)

Evaluate a nuScenes result JSON against the ground truth in the infos.

format_summary(summary)

The metrics table as the devkit's main() prints it.

ground_truth_from_infos(data_infos, ...[, ...])

The devkit's ground-truth EvalBoxes, built from mmdet3d infos.

py123detection.mmcv_plugin.evaluation.build_detection_config(class_names, class_range=None, base='detection_cvpr_2019')[source]

A devkit DetectionConfig restricted to class_names.

DetectionConfig.__init__ insists on the ten nuScenes classes, so the named base config is created first and its plain attributes are narrowed afterwards.

Parameters:

class_range (Optional[Mapping[str, float]]) – Radius in metres per class, on top of the base config’s radii.

py123detection.mmcv_plugin.evaluation.ground_truth_from_infos(data_infos, class_names, cfg, eval_version='detection_cvpr_2019')[source]

The devkit’s ground-truth EvalBoxes, built from mmdet3d infos.

Boxes are converted exactly like mmdet3d converts predictions. Every frame gets an entry, empty when it has no box of an evaluated class.

py123detection.mmcv_plugin.evaluation.evaluate_from_infos(result_path, data_infos, class_names, output_dir, class_range=None, eval_version='detection_cvpr_2019', verbose=True)[source]

Evaluate a nuScenes result JSON against the ground truth in the infos.

Follows nuscenes.eval.detection.evaluate.DetectionEval and writes the same metrics_summary.json / metrics_details.json into output_dir.

Parameters:
Return type:

Dict[str, Any]

Returns:

The serialized DetectionMetrics plus meta and evaluation blocks.

py123detection.mmcv_plugin.evaluation.format_summary(summary)[source]

The metrics table as the devkit’s main() prints it.

Return type:

str