From 64bc1c1a6505b6cd1779b65f9127180840b8a4fa Mon Sep 17 00:00:00 2001 From: Liang-Chieh Chen Date: Mon, 17 Apr 2023 17:58:44 +0000 Subject: [PATCH] Update WOD constants to match WOD spec. PiperOrigin-RevId: 524893268 --- data/dataset.py | 5 +---- data/waymo_constants.py | 18 +++++++----------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/data/dataset.py b/data/dataset.py index 7dc865e..332c7d9 100644 --- a/data/dataset.py +++ b/data/dataset.py @@ -351,10 +351,7 @@ def _build_waymo_image_panoptic_seg_dataset(**kwargs): }, ignore_label=waymo_constants.IGNORE_LABEL, panoptic_label_divisor=waymo_constants.PANOPTIC_LABEL_DIVISOR, - num_classes=len( - list( - filter(lambda val: val['id'] != waymo_constants.IGNORE_LABEL, - waymo_meta))), + num_classes=len(waymo_meta), class_has_instances_list=list( map(lambda val: val['id'], filter(lambda val: val['isthing'], waymo_meta))), diff --git a/data/waymo_constants.py b/data/waymo_constants.py index ccaafe0..df9caca 100644 --- a/data/waymo_constants.py +++ b/data/waymo_constants.py @@ -32,8 +32,8 @@ COLORMAP = "waymo" PANOPTIC_LABEL_DIVISOR = 100000 -IGNORE_LABEL_NAME = "ignore_label" -IGNORE_LABEL = 255 +IGNORE_LABEL_NAME = "unknown" +IGNORE_LABEL = 0 _WAYMO_COLORS = immutabledict.immutabledict({ "bicycle": [119, 11, 32], @@ -55,6 +55,7 @@ "pole": [153, 153, 153], "road": [128, 64, 128], "road_marker": [217, 210, 233], + "sdc": [102, 102, 102], "sidewalk": [244, 35, 232], "sign": [246, 178, 107], "sky": [70, 130, 180], @@ -62,12 +63,13 @@ "traffic_light": [250, 170, 30], "trailer": [111, 168, 220], "truck": [0, 0, 70], - "unknown(sdc)": [102, 102, 102], - "vegetation": [107, 142, 35] + "unknown": [102, 102, 102], + "vegetation": [107, 142, 35], }) _WAYMO_CLASS_NAMES = [ - "unknown(sdc)", + "unknown", + "sdc", "car", "truck", "bus", @@ -114,10 +116,4 @@ def get_waymo_meta() -> Sequence[Any]: "isthing": int(name in _IS_THINGS) } meta.append(item) - meta.append({ - "color": [0, 0, 0], - "name": IGNORE_LABEL_NAME, - "id": IGNORE_LABEL, - "isthing": 0 - }) return meta