Skip to content

Commit

Permalink
Update WOD constants to match WOD spec.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 524893268
  • Loading branch information
aquariusjay authored and YknZhu committed Apr 17, 2023
1 parent fe8ec06 commit 64bc1c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
5 changes: 1 addition & 4 deletions data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
Expand Down
18 changes: 7 additions & 11 deletions data/waymo_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -55,19 +55,21 @@
"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],
"static": [102, 102, 102],
"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",
Expand Down Expand Up @@ -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

0 comments on commit 64bc1c1

Please sign in to comment.