Commit 8348ae3c authored by liyinhao's avatar liyinhao
Browse files

fix some bugs and extra key

parent ac77413f
......@@ -37,6 +37,7 @@ class LoadPointsFromFile(object):
else:
points = np.load(pts_filename)['pc']
points = points.reshape(-1, self.load_dim)
if self.load_dim >= 6:
points[:, 3:6] = points[:, 3:6] - np.array(self.color_mean) / 256.0
points = points[:, self.use_dim]
......@@ -78,9 +79,8 @@ class LoadAnnotations3D(object):
gt_bboxes_3d = np.zeros((1, 6), dtype=np.float32)
gt_labels = np.zeros((1, 1))
gt_bboxes_3d_mask = np.zeros((1, 1))
name = 'scannet' if info.get('image', None) is None else 'sunrgbd'
if name == 'scannet':
if ins_labelname is not None and sem_labelname is not None:
assert osp.exists(ins_labelname)
assert osp.exists(sem_labelname)
pts_instance_mask = np.load(ins_labelname)
......
......@@ -12,7 +12,6 @@ def test_load_points_from_file():
6)
sunrgbd_results = dict()
data_path = './tests/data/sunrgbd/sunrgbd_trainval'
sunrgbd_results['data_path'] = data_path
sunrgbd_info = sunrgbd_info[0]
scan_name = sunrgbd_info['point_cloud']['lidar_idx']
sunrgbd_results['info'] = sunrgbd_info
......@@ -41,7 +40,6 @@ def test_load_annotations3D():
sunrgbd_info = mmcv.load('./tests/data/sunrgbd/sunrgbd_infos.pkl')
sunrgbd_load_annotations3D = LoadAnnotations3D()
sunrgbd_results = dict()
sunrgbd_results['data_path'] = './tests/data/sunrgbd/sunrgbd_trainval'
sunrgbd_results['info'] = sunrgbd_info[0]
sunrgbd_results = sunrgbd_load_annotations3D(sunrgbd_results)
sunrgbd_gt_boxes = sunrgbd_results.get('gt_bboxes_3d', None)
......@@ -55,7 +53,6 @@ def test_load_annotations3D():
scannet_load_annotations3D = LoadAnnotations3D()
scannet_results = dict()
data_path = './tests/data/scannet/scannet_train_instance_data'
scannet_results['data_path'] = data_path
scannet_info = scannet_info[0]
scan_name = scannet_info['point_cloud']['lidar_idx']
scannet_results['ins_labelname'] = osp.join(data_path,
......
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