From c471e2250ca28b3d97ea278b8e0878e99b0bc680 Mon Sep 17 00:00:00 2001 From: "yexuan.li" Date: Sat, 8 May 2021 16:22:56 +0800 Subject: [PATCH] feat(opendataset): add num_lidar/radar_pts attributes in nuScenes loader --- tensorbay/opendataset/nuScenes/catalog.json | 42 +++++++++++++-------- tensorbay/opendataset/nuScenes/loader.py | 2 + 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/tensorbay/opendataset/nuScenes/catalog.json b/tensorbay/opendataset/nuScenes/catalog.json index 73f5038ba..4b7c15080 100644 --- a/tensorbay/opendataset/nuScenes/catalog.json +++ b/tensorbay/opendataset/nuScenes/catalog.json @@ -98,21 +98,16 @@ ], "attributes": [ { - "name": "vehicle_motion", - "enum": ["moving", "parked", "stopped"], - "parentCategories": [ - "vehicle.bicycle", - "vehicle.bus.bendy", - "vehicle.bus.rigid", - "vehicle.car", - "vehicle.construction", - "vehicle.emergency.ambulance", - "vehicle.emergency.police", - "vehicle.motorcycle", - "vehicle.trailer", - "vehicle.truck" - ], - "description": "Motion of the vehicle." + "name": "num_lidar_pts", + "type": "integer", + "minimum": 0, + "description": "Number of lidar points in this box. Points are counted during the lidar sweep identified with this sample." + }, + { + "name": "num_radar_pts", + "type": "integer", + "minimum": 0, + "description": "Number of radar points in this box. Points are counted during the radar sweep identified with this sample. This number is summed across all radar sensors without any invalid point filtering." }, { "name": "cycle_rider", @@ -138,6 +133,23 @@ ], "description": "Motion of the pedestrain." }, + { + "name": "vehicle_motion", + "enum": ["moving", "parked", "stopped"], + "parentCategories": [ + "vehicle.bicycle", + "vehicle.bus.bendy", + "vehicle.bus.rigid", + "vehicle.car", + "vehicle.construction", + "vehicle.emergency.ambulance", + "vehicle.emergency.police", + "vehicle.motorcycle", + "vehicle.trailer", + "vehicle.truck" + ], + "description": "Motion of the vehicle." + }, { "name": "visibility", "enum": ["v0-40", "v40-60", "v60-80", "v80-100"], diff --git a/tensorbay/opendataset/nuScenes/loader.py b/tensorbay/opendataset/nuScenes/loader.py index e6f98366b..0c2a629d7 100644 --- a/tensorbay/opendataset/nuScenes/loader.py +++ b/tensorbay/opendataset/nuScenes/loader.py @@ -267,6 +267,8 @@ def _get_labeled_box( attributes["visibility"] = annotation_info["visibility"][ instance_annotation["visibility_token"] ]["level"] + attributes["num_lidar_pts"] = instance_annotation["num_lidar_pts"] + attributes["num_radar_pts"] = instance_annotation["num_radar_pts"] width, length, height = instance_annotation["size"] return LabeledBox3D(