From 89af92b97eb1a85f7062ba82e0d5bb24cd6590c4 Mon Sep 17 00:00:00 2001 From: holger-nutonomy <39502217+holger-nutonomy@users.noreply.github.com> Date: Tue, 21 May 2019 07:56:46 +0800 Subject: [PATCH] Print per class metrics after evaluation (#159) --- python-sdk/nuscenes/eval/detection/evaluate.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/python-sdk/nuscenes/eval/detection/evaluate.py b/python-sdk/nuscenes/eval/detection/evaluate.py index 47ed1cc8..5ca8eb23 100644 --- a/python-sdk/nuscenes/eval/detection/evaluate.py +++ b/python-sdk/nuscenes/eval/detection/evaluate.py @@ -229,6 +229,21 @@ def main(self, print('NDS: %.4f' % (metrics_summary['nd_score'])) print('Eval time: %.1fs' % metrics_summary['eval_time']) + # Print per-class metrics. + print() + print('Per-class results:') + print('Object Class\tAP\tATE\tASE\tAOE\tAVE\tAAE') + class_aps = metrics_summary['mean_dist_aps'] + class_tps = metrics_summary['label_tp_errors'] + for class_name in class_aps.keys(): + print('%s\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f' + % (class_name, class_aps[class_name], + class_tps[class_name]['trans_err'], + class_tps[class_name]['scale_err'], + class_tps[class_name]['orient_err'], + class_tps[class_name]['vel_err'], + class_tps[class_name]['attr_err'])) + return metrics_summary