Unverified Commit ea22f8ec authored by Qing Lian's avatar Qing Lian Committed by GitHub
Browse files

add METAINFO for waymo dataset and support file_client_args for waymo evaluation (#1769)

parent c9ff1832
...@@ -59,8 +59,7 @@ class WaymoDataset(KittiDataset): ...@@ -59,8 +59,7 @@ class WaymoDataset(KittiDataset):
mono3d: take the groundtruth that can be seen in the cam. mono3d: take the groundtruth that can be seen in the cam.
max_sweeps (int, optional): max sweep for each frame. max_sweeps (int, optional): max sweep for each frame.
""" """
METAINFO = {'CLASSES': ('Car', 'Pedestrian', 'Cyclist')}
CLASSES = ('Car', 'Pedestrian', 'Cyclist')
def __init__(self, def __init__(self,
data_root: str, data_root: str,
...@@ -88,7 +87,7 @@ class WaymoDataset(KittiDataset): ...@@ -88,7 +87,7 @@ class WaymoDataset(KittiDataset):
# set loading mode for different task settings # set loading mode for different task settings
self.cam_sync_instances = cam_sync_instances self.cam_sync_instances = cam_sync_instances
# construct self.cat_ids for vision-only anns parsing # construct self.cat_ids for vision-only anns parsing
self.cat_ids = range(len(self.CLASSES)) self.cat_ids = range(len(self.METAINFO['CLASSES']))
self.cat2label = {cat_id: i for i, cat_id in enumerate(self.cat_ids)} self.cat2label = {cat_id: i for i, cat_id in enumerate(self.cat_ids)}
self.max_sweeps = max_sweeps self.max_sweeps = max_sweeps
self.task = task self.task = task
......
...@@ -73,7 +73,6 @@ class WaymoMetric(KittiMetric): ...@@ -73,7 +73,6 @@ class WaymoMetric(KittiMetric):
self.waymo_bin_file = waymo_bin_file self.waymo_bin_file = waymo_bin_file
self.data_root = data_root self.data_root = data_root
self.file_client_args = file_client_args
self.split = split self.split = split
self.task = task self.task = task
self.use_pred_sample_idx = use_pred_sample_idx self.use_pred_sample_idx = use_pred_sample_idx
...@@ -85,7 +84,8 @@ class WaymoMetric(KittiMetric): ...@@ -85,7 +84,8 @@ class WaymoMetric(KittiMetric):
pklfile_prefix=pklfile_prefix, pklfile_prefix=pklfile_prefix,
submission_prefix=submission_prefix, submission_prefix=submission_prefix,
default_cam_key=default_cam_key, default_cam_key=default_cam_key,
collect_device=collect_device) collect_device=collect_device,
file_client_args=file_client_args)
self.default_prefix = 'Waymo metric' self.default_prefix = 'Waymo metric'
def compute_metrics(self, results: list) -> Dict[str, float]: def compute_metrics(self, results: list) -> Dict[str, float]:
...@@ -102,8 +102,7 @@ class WaymoMetric(KittiMetric): ...@@ -102,8 +102,7 @@ class WaymoMetric(KittiMetric):
self.classes = self.dataset_meta['CLASSES'] self.classes = self.dataset_meta['CLASSES']
# load annotations # load annotations
self.data_infos = load( self.data_infos = load(self.ann_file)['data_list']
self.ann_file, file_client_args=self.file_client_args)['data_list']
# different from kitti, waymo do not need to convert the ann file # different from kitti, waymo do not need to convert the ann file
if self.pklfile_prefix is None: if self.pklfile_prefix is None:
......
...@@ -75,6 +75,10 @@ def replace_ceph_backend(cfg): ...@@ -75,6 +75,10 @@ def replace_ceph_backend(cfg):
cfg_pretty_text = cfg_pretty_text.replace( cfg_pretty_text = cfg_pretty_text.replace(
'LoadAnnotations3D\'', 'LoadAnnotations3D\',' + replace_strs) 'LoadAnnotations3D\'', 'LoadAnnotations3D\',' + replace_strs)
# replace WaymoMetric
cfg_pretty_text = cfg_pretty_text.replace('WaymoMetric\'',
'WaymoMetric\',' + replace_strs)
# replace dbsampler # replace dbsampler
cfg_pretty_text = cfg_pretty_text.replace('info_path', cfg_pretty_text = cfg_pretty_text.replace('info_path',
replace_strs + ', info_path') replace_strs + ', info_path')
......
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