Commit fd2e572e authored by liyinhao's avatar liyinhao
Browse files

change astype to dtype

parent 90602f7e
...@@ -40,12 +40,12 @@ def test_load_annotations3D(): ...@@ -40,12 +40,12 @@ def test_load_annotations3D():
if sunrgbd_info['annos']['gt_num'] != 0: if sunrgbd_info['annos']['gt_num'] != 0:
sunrgbd_gt_bboxes_3d = sunrgbd_info['annos']['gt_boxes_upright_depth'] sunrgbd_gt_bboxes_3d = sunrgbd_info['annos']['gt_boxes_upright_depth']
sunrgbd_gt_labels_3d = sunrgbd_info['annos']['class'] sunrgbd_gt_labels_3d = sunrgbd_info['annos']['class']
sunrgbd_gt_bboxes_3d_mask = np.ones_like(sunrgbd_gt_labels_3d).astype( sunrgbd_gt_bboxes_3d_mask = np.ones_like(
np.bool) sunrgbd_gt_labels_3d, dtype=np.bool)
else: else:
sunrgbd_gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32) sunrgbd_gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32)
sunrgbd_gt_labels_3d = np.zeros((1, )) sunrgbd_gt_labels_3d = np.zeros((1, ))
sunrgbd_gt_bboxes_3d_mask = np.zeros((1, )) sunrgbd_gt_bboxes_3d_mask = np.zeros((1, ), dtype=np.bool)
assert sunrgbd_gt_bboxes_3d.shape == (3, 7) assert sunrgbd_gt_bboxes_3d.shape == (3, 7)
assert sunrgbd_gt_labels_3d.shape == (3, ) assert sunrgbd_gt_labels_3d.shape == (3, )
assert sunrgbd_gt_bboxes_3d_mask.shape == (3, ) assert sunrgbd_gt_bboxes_3d_mask.shape == (3, )
...@@ -57,12 +57,12 @@ def test_load_annotations3D(): ...@@ -57,12 +57,12 @@ def test_load_annotations3D():
if scannet_info['annos']['gt_num'] != 0: if scannet_info['annos']['gt_num'] != 0:
scannet_gt_bboxes_3d = scannet_info['annos']['gt_boxes_upright_depth'] scannet_gt_bboxes_3d = scannet_info['annos']['gt_boxes_upright_depth']
scannet_gt_labels_3d = scannet_info['annos']['class'] scannet_gt_labels_3d = scannet_info['annos']['class']
scannet_gt_bboxes_3d_mask = np.ones_like(scannet_gt_labels_3d).astype( scannet_gt_bboxes_3d_mask = np.ones_like(
np.bool) scannet_gt_labels_3d, dtype=np.bool)
else: else:
scannet_gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32) scannet_gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32)
scannet_gt_labels_3d = np.zeros((1, )) scannet_gt_labels_3d = np.zeros((1, ))
scannet_gt_bboxes_3d_mask = np.zeros((1, )).astype(np.bool) scannet_gt_bboxes_3d_mask = np.zeros((1, ), dtype=np.bool)
scan_name = scannet_info['point_cloud']['lidar_idx'] scan_name = scannet_info['point_cloud']['lidar_idx']
scannet_results['pts_instance_mask_path'] = osp.join( scannet_results['pts_instance_mask_path'] = osp.join(
data_path, f'{scan_name}_ins_label.npy') data_path, f'{scan_name}_ins_label.npy')
......
...@@ -45,12 +45,12 @@ def test_scannet_pipeline(): ...@@ -45,12 +45,12 @@ def test_scannet_pipeline():
if info['annos']['gt_num'] != 0: if info['annos']['gt_num'] != 0:
scannet_gt_bboxes_3d = info['annos']['gt_boxes_upright_depth'] scannet_gt_bboxes_3d = info['annos']['gt_boxes_upright_depth']
scannet_gt_labels_3d = info['annos']['class'] scannet_gt_labels_3d = info['annos']['class']
scannet_gt_bboxes_3d_mask = np.ones_like(scannet_gt_labels_3d).astype( scannet_gt_bboxes_3d_mask = np.ones_like(
np.bool) scannet_gt_labels_3d, dtype=np.bool)
else: else:
scannet_gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32) scannet_gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32)
scannet_gt_labels_3d = np.zeros((1, )) scannet_gt_labels_3d = np.zeros((1, ))
scannet_gt_bboxes_3d_mask = np.zeros((1, )).astype(np.bool) scannet_gt_bboxes_3d_mask = np.zeros((1, ), dtype=np.bool)
scan_name = info['point_cloud']['lidar_idx'] scan_name = info['point_cloud']['lidar_idx']
results['pts_instance_mask_path'] = osp.join(data_path, results['pts_instance_mask_path'] = osp.join(data_path,
...@@ -126,11 +126,11 @@ def test_sunrgbd_pipeline(): ...@@ -126,11 +126,11 @@ def test_sunrgbd_pipeline():
if info['annos']['gt_num'] != 0: if info['annos']['gt_num'] != 0:
gt_bboxes_3d = info['annos']['gt_boxes_upright_depth'] gt_bboxes_3d = info['annos']['gt_boxes_upright_depth']
gt_labels_3d = info['annos']['class'] gt_labels_3d = info['annos']['class']
gt_bboxes_3d_mask = np.ones_like(gt_labels_3d).astype(np.bool) gt_bboxes_3d_mask = np.ones_like(gt_labels_3d, dtype=np.bool)
else: else:
gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32) gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32)
gt_labels_3d = np.zeros((1, )) gt_labels_3d = np.zeros((1, ))
gt_bboxes_3d_mask = np.zeros((1, )).astype(np.bool) gt_bboxes_3d_mask = np.zeros((1, ), dtype=np.bool)
results['gt_bboxes_3d'] = gt_bboxes_3d results['gt_bboxes_3d'] = gt_bboxes_3d
results['gt_labels_3d'] = gt_labels_3d results['gt_labels_3d'] = gt_labels_3d
......
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