Unverified Commit c37a7a1d authored by Shaoshuai Shi's avatar Shaoshuai Shi Committed by GitHub
Browse files

bugfixed: add num_points_in_gt to the waymo_infos for evaluation (#383)

parent 59496284
...@@ -23,7 +23,7 @@ WAYMO_CLASSES = ['unknown', 'Vehicle', 'Pedestrian', 'Sign', 'Cyclist'] ...@@ -23,7 +23,7 @@ WAYMO_CLASSES = ['unknown', 'Vehicle', 'Pedestrian', 'Sign', 'Cyclist']
def generate_labels(frame): def generate_labels(frame):
obj_name, difficulty, dimensions, locations, heading_angles = [], [], [], [], [] obj_name, difficulty, dimensions, locations, heading_angles = [], [], [], [], []
tracking_difficulty, speeds, accelerations, obj_ids = [], [], [], [] tracking_difficulty, speeds, accelerations, obj_ids = [], [], [], []
num_points_in_gt = []
laser_labels = frame.laser_labels laser_labels = frame.laser_labels
for i in range(len(laser_labels)): for i in range(len(laser_labels)):
box = laser_labels[i].box box = laser_labels[i].box
...@@ -36,6 +36,7 @@ def generate_labels(frame): ...@@ -36,6 +36,7 @@ def generate_labels(frame):
dimensions.append([box.length, box.width, box.height]) # lwh in unified coordinate of OpenPCDet dimensions.append([box.length, box.width, box.height]) # lwh in unified coordinate of OpenPCDet
locations.append(loc) locations.append(loc)
obj_ids.append(laser_labels[i].id) obj_ids.append(laser_labels[i].id)
num_points_in_gt.append(laser_labels[i].num_lidar_points_in_box)
annotations = {} annotations = {}
annotations['name'] = np.array(obj_name) annotations['name'] = np.array(obj_name)
...@@ -46,6 +47,7 @@ def generate_labels(frame): ...@@ -46,6 +47,7 @@ def generate_labels(frame):
annotations['obj_ids'] = np.array(obj_ids) annotations['obj_ids'] = np.array(obj_ids)
annotations['tracking_difficulty'] = np.array(tracking_difficulty) annotations['tracking_difficulty'] = np.array(tracking_difficulty)
annotations['num_points_in_gt'] = np.array(num_points_in_gt)
annotations = common_utils.drop_info_with_name(annotations, name='unknown') annotations = common_utils.drop_info_with_name(annotations, name='unknown')
if annotations['name'].__len__() > 0: if annotations['name'].__len__() > 0:
......
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