Commit 96ba76a3 authored by Shaoshuai Shi's avatar Shaoshuai Shi
Browse files

database should save with np.float32

parent 7e2d56b4
...@@ -225,7 +225,7 @@ class WaymoDataset(DatasetTemplate): ...@@ -225,7 +225,7 @@ class WaymoDataset(DatasetTemplate):
points_pre = remove_ego_points(points_pre, 1.0) points_pre = remove_ego_points(points_pre, 1.0)
points_pre_all.append(points_pre) points_pre_all.append(points_pre)
num_points_pre.append(points_pre.shape[0]) num_points_pre.append(points_pre.shape[0])
points = np.concatenate([points] + points_pre_all, axis=0) points = np.concatenate([points] + points_pre_all, axis=0).astype(np.float32)
num_points_all = np.array([num_pts_cur] + num_points_pre).astype(np.int) num_points_all = np.array([num_pts_cur] + num_points_pre).astype(np.int)
return points, num_points_all, sample_idx_pre_list return points, num_points_all, sample_idx_pre_list
...@@ -461,6 +461,8 @@ class WaymoDataset(DatasetTemplate): ...@@ -461,6 +461,8 @@ class WaymoDataset(DatasetTemplate):
gt_points[:, :3] -= gt_boxes[i, :3] gt_points[:, :3] -= gt_boxes[i, :3]
if (used_classes is None) or names[i] in used_classes: if (used_classes is None) or names[i] in used_classes:
gt_points = gt_points.astype(np.float32)
assert gt_points.dtype == np.float32
with open(filepath, 'w') as f: with open(filepath, 'w') as f:
gt_points.tofile(f) gt_points.tofile(f)
...@@ -546,6 +548,8 @@ class WaymoDataset(DatasetTemplate): ...@@ -546,6 +548,8 @@ class WaymoDataset(DatasetTemplate):
gt_points[:, :3] -= gt_boxes[i, :3] gt_points[:, :3] -= gt_boxes[i, :3]
if (used_classes is None) or names[i] in used_classes: if (used_classes is None) or names[i] in used_classes:
gt_points = gt_points.astype(np.float32)
assert gt_points.dtype == np.float32
with open(filepath, 'w') as f: with open(filepath, 'w') as f:
gt_points.tofile(f) gt_points.tofile(f)
......
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