Unverified Commit 4af2144c authored by Ziyi Wu's avatar Ziyi Wu Committed by GitHub
Browse files

[Fix] Fix evaluation bugs in Nus and Lyft datasets (#549)

* fix if condition to enable KITTI detectors eval on nus/lyft datasets

* fix comments
parent 3bac800e
...@@ -335,9 +335,16 @@ class LyftDataset(Custom3DDataset): ...@@ -335,9 +335,16 @@ class LyftDataset(Custom3DDataset):
else: else:
tmp_dir = None tmp_dir = None
if not isinstance(results[0], dict): # currently the output prediction results could be in two formats
# 1. list of dict('boxes_3d': ..., 'scores_3d': ..., 'labels_3d': ...)
# 2. list of dict('pts_bbox' or 'img_bbox':
# dict('boxes_3d': ..., 'scores_3d': ..., 'labels_3d': ...))
# this is a workaround to enable evaluation of both formats on Lyft
# refer to https://github.com/open-mmlab/mmdetection3d/issues/449
if not ('pts_bbox' in results[0] or 'img_bbox' in results[0]):
result_files = self._format_bbox(results, jsonfile_prefix) result_files = self._format_bbox(results, jsonfile_prefix)
else: else:
# should take the inner dict out of 'pts_bbox' or 'img_bbox' dict
result_files = dict() result_files = dict()
for name in results[0]: for name in results[0]:
print(f'\nFormating bboxes of {name}') print(f'\nFormating bboxes of {name}')
......
...@@ -435,9 +435,16 @@ class NuScenesDataset(Custom3DDataset): ...@@ -435,9 +435,16 @@ class NuScenesDataset(Custom3DDataset):
else: else:
tmp_dir = None tmp_dir = None
if not isinstance(results[0], dict): # currently the output prediction results could be in two formats
# 1. list of dict('boxes_3d': ..., 'scores_3d': ..., 'labels_3d': ...)
# 2. list of dict('pts_bbox' or 'img_bbox':
# dict('boxes_3d': ..., 'scores_3d': ..., 'labels_3d': ...))
# this is a workaround to enable evaluation of both formats on nuScenes
# refer to https://github.com/open-mmlab/mmdetection3d/issues/449
if not ('pts_bbox' in results[0] or 'img_bbox' in results[0]):
result_files = self._format_bbox(results, jsonfile_prefix) result_files = self._format_bbox(results, jsonfile_prefix)
else: else:
# should take the inner dict out of 'pts_bbox' or 'img_bbox' dict
result_files = dict() result_files = dict()
for name in results[0]: for name in results[0]:
print(f'\nFormating bboxes of {name}') print(f'\nFormating bboxes of {name}')
......
...@@ -454,9 +454,16 @@ class NuScenesMonoDataset(CocoDataset): ...@@ -454,9 +454,16 @@ class NuScenesMonoDataset(CocoDataset):
else: else:
tmp_dir = None tmp_dir = None
if not isinstance(results[0], dict): # currently the output prediction results could be in two formats
# 1. list of dict('boxes_3d': ..., 'scores_3d': ..., 'labels_3d': ...)
# 2. list of dict('pts_bbox' or 'img_bbox':
# dict('boxes_3d': ..., 'scores_3d': ..., 'labels_3d': ...))
# this is a workaround to enable evaluation of both formats on nuScenes
# refer to https://github.com/open-mmlab/mmdetection3d/issues/449
if not ('pts_bbox' in results[0] or 'img_bbox' in results[0]):
result_files = self._format_bbox(results, jsonfile_prefix) result_files = self._format_bbox(results, jsonfile_prefix)
else: else:
# should take the inner dict out of 'pts_bbox' or 'img_bbox' dict
result_files = dict() result_files = dict()
for name in results[0]: for name in results[0]:
# not evaluate 2D predictions on nuScenes # not evaluate 2D predictions on nuScenes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment