Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
71707334
Commit
71707334
authored
Mar 02, 2022
by
WRH
Committed by
ZwwWayne
Mar 03, 2022
Browse files
Fix np.long for windows (#1270)
* change np.long to np.int64 * change all log to int64
parent
145e592e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
30 additions
and
30 deletions
+30
-30
docs/en/tutorials/customize_dataset.md
docs/en/tutorials/customize_dataset.md
+2
-2
docs/zh_cn/tutorials/customize_dataset.md
docs/zh_cn/tutorials/customize_dataset.md
+2
-2
mmdet3d/datasets/pipelines/loading.py
mmdet3d/datasets/pipelines/loading.py
+2
-2
mmdet3d/datasets/pipelines/transforms_3d.py
mmdet3d/datasets/pipelines/transforms_3d.py
+1
-1
mmdet3d/datasets/s3dis_dataset.py
mmdet3d/datasets/s3dis_dataset.py
+2
-2
mmdet3d/datasets/scannet_dataset.py
mmdet3d/datasets/scannet_dataset.py
+2
-2
mmdet3d/datasets/sunrgbd_dataset.py
mmdet3d/datasets/sunrgbd_dataset.py
+2
-2
tests/test_data/test_pipelines/test_augmentations/test_transforms_3d.py
...a/test_pipelines/test_augmentations/test_transforms_3d.py
+7
-7
tests/test_data/test_pipelines/test_indoor_pipeline.py
tests/test_data/test_pipelines/test_indoor_pipeline.py
+4
-4
tests/test_data/test_pipelines/test_indoor_sample.py
tests/test_data/test_pipelines/test_indoor_sample.py
+2
-2
tools/data_converter/s3dis_data_utils.py
tools/data_converter/s3dis_data_utils.py
+1
-1
tools/data_converter/scannet_data_utils.py
tools/data_converter/scannet_data_utils.py
+3
-3
No files found.
docs/en/tutorials/customize_dataset.md
View file @
71707334
...
@@ -134,10 +134,10 @@ class MyDataset(Custom3DDataset):
...
@@ -134,10 +134,10 @@ class MyDataset(Custom3DDataset):
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
# k, 6
np
.
float32
)
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
int64
)
# to target box structure
# to target box structure
gt_bboxes_3d
=
DepthInstance3DBoxes
(
gt_bboxes_3d
=
DepthInstance3DBoxes
(
...
...
docs/zh_cn/tutorials/customize_dataset.md
View file @
71707334
...
@@ -130,10 +130,10 @@ class MyDataset(Custom3DDataset):
...
@@ -130,10 +130,10 @@ class MyDataset(Custom3DDataset):
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
# k, 6
np
.
float32
)
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
int64
)
# 转换为目标标注框的结构
# 转换为目标标注框的结构
gt_bboxes_3d
=
DepthInstance3DBoxes
(
gt_bboxes_3d
=
DepthInstance3DBoxes
(
...
...
mmdet3d/datasets/pipelines/loading.py
View file @
71707334
...
@@ -604,7 +604,7 @@ class LoadAnnotations3D(LoadAnnotations):
...
@@ -604,7 +604,7 @@ class LoadAnnotations3D(LoadAnnotations):
except
ConnectionError
:
except
ConnectionError
:
mmcv
.
check_file_exist
(
pts_instance_mask_path
)
mmcv
.
check_file_exist
(
pts_instance_mask_path
)
pts_instance_mask
=
np
.
fromfile
(
pts_instance_mask
=
np
.
fromfile
(
pts_instance_mask_path
,
dtype
=
np
.
long
)
pts_instance_mask_path
,
dtype
=
np
.
int64
)
results
[
'pts_instance_mask'
]
=
pts_instance_mask
results
[
'pts_instance_mask'
]
=
pts_instance_mask
results
[
'pts_mask_fields'
].
append
(
'pts_instance_mask'
)
results
[
'pts_mask_fields'
].
append
(
'pts_instance_mask'
)
...
@@ -631,7 +631,7 @@ class LoadAnnotations3D(LoadAnnotations):
...
@@ -631,7 +631,7 @@ class LoadAnnotations3D(LoadAnnotations):
except
ConnectionError
:
except
ConnectionError
:
mmcv
.
check_file_exist
(
pts_semantic_mask_path
)
mmcv
.
check_file_exist
(
pts_semantic_mask_path
)
pts_semantic_mask
=
np
.
fromfile
(
pts_semantic_mask
=
np
.
fromfile
(
pts_semantic_mask_path
,
dtype
=
np
.
long
)
pts_semantic_mask_path
,
dtype
=
np
.
int64
)
results
[
'pts_semantic_mask'
]
=
pts_semantic_mask
results
[
'pts_semantic_mask'
]
=
pts_semantic_mask
results
[
'pts_seg_fields'
].
append
(
'pts_semantic_mask'
)
results
[
'pts_seg_fields'
].
append
(
'pts_semantic_mask'
)
...
...
mmdet3d/datasets/pipelines/transforms_3d.py
View file @
71707334
...
@@ -356,7 +356,7 @@ class ObjectSample(object):
...
@@ -356,7 +356,7 @@ class ObjectSample(object):
input_dict
[
'img'
]
=
sampled_dict
[
'img'
]
input_dict
[
'img'
]
=
sampled_dict
[
'img'
]
input_dict
[
'gt_bboxes_3d'
]
=
gt_bboxes_3d
input_dict
[
'gt_bboxes_3d'
]
=
gt_bboxes_3d
input_dict
[
'gt_labels_3d'
]
=
gt_labels_3d
.
astype
(
np
.
long
)
input_dict
[
'gt_labels_3d'
]
=
gt_labels_3d
.
astype
(
np
.
int64
)
input_dict
[
'points'
]
=
points
input_dict
[
'points'
]
=
points
return
input_dict
return
input_dict
...
...
mmdet3d/datasets/s3dis_dataset.py
View file @
71707334
...
@@ -85,10 +85,10 @@ class S3DISDataset(Custom3DDataset):
...
@@ -85,10 +85,10 @@ class S3DISDataset(Custom3DDataset):
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
# k, 6
np
.
float32
)
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
int64
)
# to target box structure
# to target box structure
gt_bboxes_3d
=
DepthInstance3DBoxes
(
gt_bboxes_3d
=
DepthInstance3DBoxes
(
...
...
mmdet3d/datasets/scannet_dataset.py
View file @
71707334
...
@@ -143,10 +143,10 @@ class ScanNetDataset(Custom3DDataset):
...
@@ -143,10 +143,10 @@ class ScanNetDataset(Custom3DDataset):
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
# k, 6
np
.
float32
)
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
int64
)
# to target box structure
# to target box structure
gt_bboxes_3d
=
DepthInstance3DBoxes
(
gt_bboxes_3d
=
DepthInstance3DBoxes
(
...
...
mmdet3d/datasets/sunrgbd_dataset.py
View file @
71707334
...
@@ -137,10 +137,10 @@ class SUNRGBDDataset(Custom3DDataset):
...
@@ -137,10 +137,10 @@ class SUNRGBDDataset(Custom3DDataset):
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
# k, 6
np
.
float32
)
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
0
,
7
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
7
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
zeros
((
0
,
),
dtype
=
np
.
int64
)
# to target box structure
# to target box structure
gt_bboxes_3d
=
DepthInstance3DBoxes
(
gt_bboxes_3d
=
DepthInstance3DBoxes
(
...
...
tests/test_data/test_pipelines/test_augmentations/test_transforms_3d.py
View file @
71707334
...
@@ -88,7 +88,7 @@ def test_object_sample():
...
@@ -88,7 +88,7 @@ def test_object_sample():
gt_labels
.
append
(
CLASSES
.
index
(
cat
))
gt_labels
.
append
(
CLASSES
.
index
(
cat
))
else
:
else
:
gt_labels
.
append
(
-
1
)
gt_labels
.
append
(
-
1
)
gt_labels
=
np
.
array
(
gt_labels
,
dtype
=
np
.
long
)
gt_labels
=
np
.
array
(
gt_labels
,
dtype
=
np
.
int64
)
points
=
LiDARPoints
(
points
,
points_dim
=
4
)
points
=
LiDARPoints
(
points
,
points_dim
=
4
)
input_dict
=
dict
(
input_dict
=
dict
(
points
=
points
,
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_labels_3d
=
gt_labels
)
points
=
points
,
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_labels_3d
=
gt_labels
)
...
@@ -176,7 +176,7 @@ def test_object_name_filter():
...
@@ -176,7 +176,7 @@ def test_object_name_filter():
gt_labels
.
append
(
CLASSES
.
index
(
cat
))
gt_labels
.
append
(
CLASSES
.
index
(
cat
))
else
:
else
:
gt_labels
.
append
(
-
1
)
gt_labels
.
append
(
-
1
)
gt_labels
=
np
.
array
(
gt_labels
,
dtype
=
np
.
long
)
gt_labels
=
np
.
array
(
gt_labels
,
dtype
=
np
.
int64
)
input_dict
=
dict
(
input_dict
=
dict
(
gt_bboxes_3d
=
gt_bboxes_3d
.
clone
(),
gt_labels_3d
=
gt_labels
.
copy
())
gt_bboxes_3d
=
gt_bboxes_3d
.
clone
(),
gt_labels_3d
=
gt_labels
.
copy
())
...
@@ -200,9 +200,9 @@ def test_point_shuffle():
...
@@ -200,9 +200,9 @@ def test_point_shuffle():
points
=
np
.
fromfile
(
'tests/data/scannet/points/scene0000_00.bin'
,
points
=
np
.
fromfile
(
'tests/data/scannet/points/scene0000_00.bin'
,
np
.
float32
).
reshape
(
-
1
,
6
)
np
.
float32
).
reshape
(
-
1
,
6
)
ins_mask
=
np
.
fromfile
(
'tests/data/scannet/instance_mask/scene0000_00.bin'
,
ins_mask
=
np
.
fromfile
(
'tests/data/scannet/instance_mask/scene0000_00.bin'
,
np
.
long
)
np
.
int64
)
sem_mask
=
np
.
fromfile
(
'tests/data/scannet/semantic_mask/scene0000_00.bin'
,
sem_mask
=
np
.
fromfile
(
'tests/data/scannet/semantic_mask/scene0000_00.bin'
,
np
.
long
)
np
.
int64
)
points
=
DepthPoints
(
points
=
DepthPoints
(
points
.
copy
(),
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
points
.
copy
(),
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
...
@@ -244,9 +244,9 @@ def test_points_range_filter():
...
@@ -244,9 +244,9 @@ def test_points_range_filter():
points
=
np
.
fromfile
(
'tests/data/scannet/points/scene0000_00.bin'
,
points
=
np
.
fromfile
(
'tests/data/scannet/points/scene0000_00.bin'
,
np
.
float32
).
reshape
(
-
1
,
6
)
np
.
float32
).
reshape
(
-
1
,
6
)
ins_mask
=
np
.
fromfile
(
'tests/data/scannet/instance_mask/scene0000_00.bin'
,
ins_mask
=
np
.
fromfile
(
'tests/data/scannet/instance_mask/scene0000_00.bin'
,
np
.
long
)
np
.
int64
)
sem_mask
=
np
.
fromfile
(
'tests/data/scannet/semantic_mask/scene0000_00.bin'
,
sem_mask
=
np
.
fromfile
(
'tests/data/scannet/semantic_mask/scene0000_00.bin'
,
np
.
long
)
np
.
int64
)
points
=
DepthPoints
(
points
=
DepthPoints
(
points
.
copy
(),
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
points
.
copy
(),
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
...
@@ -286,7 +286,7 @@ def test_object_range_filter():
...
@@ -286,7 +286,7 @@ def test_object_range_filter():
[
18.7314
,
-
18.559
,
20.6547
,
6.4800
,
8.6000
,
3.9200
,
-
1.0100
],
[
18.7314
,
-
18.559
,
20.6547
,
6.4800
,
8.6000
,
3.9200
,
-
1.0100
],
[
3.7314
,
42.559
,
-
0.6547
,
6.4800
,
8.6000
,
2.9200
,
3.0100
]])
[
3.7314
,
42.559
,
-
0.6547
,
6.4800
,
8.6000
,
2.9200
,
3.0100
]])
gt_bboxes_3d
=
LiDARInstance3DBoxes
(
bbox
,
origin
=
(
0.5
,
0.5
,
0.5
))
gt_bboxes_3d
=
LiDARInstance3DBoxes
(
bbox
,
origin
=
(
0.5
,
0.5
,
0.5
))
gt_labels_3d
=
np
.
array
([
0
,
2
,
1
,
1
,
2
,
0
],
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
array
([
0
,
2
,
1
,
1
,
2
,
0
],
dtype
=
np
.
int64
)
input_dict
=
dict
(
input_dict
=
dict
(
gt_bboxes_3d
=
gt_bboxes_3d
.
clone
(),
gt_labels_3d
=
gt_labels_3d
.
copy
())
gt_bboxes_3d
=
gt_bboxes_3d
.
clone
(),
gt_labels_3d
=
gt_labels_3d
.
copy
())
...
...
tests/test_data/test_pipelines/test_indoor_pipeline.py
View file @
71707334
...
@@ -61,10 +61,10 @@ def test_scannet_pipeline():
...
@@ -61,10 +61,10 @@ 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'
].
astype
(
scannet_gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
np
.
float32
)
scannet_gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
scannet_gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
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
,
),
dtype
=
np
.
long
)
scannet_gt_labels_3d
=
np
.
zeros
((
1
,
),
dtype
=
np
.
int64
)
results
[
'ann_info'
]
=
dict
()
results
[
'ann_info'
]
=
dict
()
results
[
'ann_info'
][
'pts_instance_mask_path'
]
=
osp
.
join
(
results
[
'ann_info'
][
'pts_instance_mask_path'
]
=
osp
.
join
(
data_path
,
info
[
'pts_instance_mask_path'
])
data_path
,
info
[
'pts_instance_mask_path'
])
...
@@ -294,10 +294,10 @@ def test_sunrgbd_pipeline():
...
@@ -294,10 +294,10 @@ 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'
].
astype
(
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
].
astype
(
np
.
float32
)
np
.
float32
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
long
)
gt_labels_3d
=
info
[
'annos'
][
'class'
].
astype
(
np
.
int64
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
1
,
7
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
1
,
7
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
((
1
,
),
dtype
=
np
.
long
)
gt_labels_3d
=
np
.
zeros
((
1
,
),
dtype
=
np
.
int64
)
# prepare input of pipeline
# prepare input of pipeline
results
[
'ann_info'
]
=
dict
()
results
[
'ann_info'
]
=
dict
()
...
...
tests/test_data/test_pipelines/test_indoor_sample.py
View file @
71707334
...
@@ -82,7 +82,7 @@ def test_indoor_seg_sample():
...
@@ -82,7 +82,7 @@ def test_indoor_seg_sample():
scannet_points
,
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
scannet_points
,
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
scannet_pts_semantic_mask
=
np
.
fromfile
(
scannet_pts_semantic_mask
=
np
.
fromfile
(
'./tests/data/scannet/semantic_mask/scene0000_00.bin'
,
dtype
=
np
.
long
)
'./tests/data/scannet/semantic_mask/scene0000_00.bin'
,
dtype
=
np
.
int64
)
scannet_results
[
'pts_semantic_mask'
]
=
scannet_pts_semantic_mask
scannet_results
[
'pts_semantic_mask'
]
=
scannet_pts_semantic_mask
scannet_results
=
scannet_seg_class_mapping
(
scannet_results
)
scannet_results
=
scannet_seg_class_mapping
(
scannet_results
)
...
@@ -174,7 +174,7 @@ def test_indoor_seg_sample():
...
@@ -174,7 +174,7 @@ def test_indoor_seg_sample():
s3dis_points
,
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
s3dis_points
,
points_dim
=
6
,
attribute_dims
=
dict
(
color
=
[
3
,
4
,
5
]))
s3dis_pts_semantic_mask
=
np
.
fromfile
(
s3dis_pts_semantic_mask
=
np
.
fromfile
(
'./tests/data/s3dis/semantic_mask/Area_1_office_2.bin'
,
dtype
=
np
.
long
)
'./tests/data/s3dis/semantic_mask/Area_1_office_2.bin'
,
dtype
=
np
.
int64
)
s3dis_results
[
'pts_semantic_mask'
]
=
s3dis_pts_semantic_mask
s3dis_results
[
'pts_semantic_mask'
]
=
s3dis_pts_semantic_mask
s3dis_results
=
s3dis_patch_sample_points
(
s3dis_results
)
s3dis_results
=
s3dis_patch_sample_points
(
s3dis_results
)
...
...
tools/data_converter/s3dis_data_utils.py
View file @
71707334
...
@@ -208,7 +208,7 @@ class S3DISSegData(object):
...
@@ -208,7 +208,7 @@ class S3DISSegData(object):
if
mask
.
endswith
(
'npy'
):
if
mask
.
endswith
(
'npy'
):
mask
=
np
.
load
(
mask
)
mask
=
np
.
load
(
mask
)
else
:
else
:
mask
=
np
.
fromfile
(
mask
,
dtype
=
np
.
long
)
mask
=
np
.
fromfile
(
mask
,
dtype
=
np
.
int64
)
label
=
self
.
cat_id2class
[
mask
]
label
=
self
.
cat_id2class
[
mask
]
return
label
return
label
...
...
tools/data_converter/scannet_data_utils.py
View file @
71707334
...
@@ -138,9 +138,9 @@ class ScanNetData(object):
...
@@ -138,9 +138,9 @@ class ScanNetData(object):
f
'
{
sample_idx
}
_sem_label.npy'
)
f
'
{
sample_idx
}
_sem_label.npy'
)
pts_instance_mask
=
np
.
load
(
pts_instance_mask_path
).
astype
(
pts_instance_mask
=
np
.
load
(
pts_instance_mask_path
).
astype
(
np
.
long
)
np
.
int64
)
pts_semantic_mask
=
np
.
load
(
pts_semantic_mask_path
).
astype
(
pts_semantic_mask
=
np
.
load
(
pts_semantic_mask_path
).
astype
(
np
.
long
)
np
.
int64
)
mmcv
.
mkdir_or_exist
(
osp
.
join
(
self
.
root_dir
,
'instance_mask'
))
mmcv
.
mkdir_or_exist
(
osp
.
join
(
self
.
root_dir
,
'instance_mask'
))
mmcv
.
mkdir_or_exist
(
osp
.
join
(
self
.
root_dir
,
'semantic_mask'
))
mmcv
.
mkdir_or_exist
(
osp
.
join
(
self
.
root_dir
,
'semantic_mask'
))
...
@@ -260,7 +260,7 @@ class ScanNetSegData(object):
...
@@ -260,7 +260,7 @@ class ScanNetSegData(object):
if
mask
.
endswith
(
'npy'
):
if
mask
.
endswith
(
'npy'
):
mask
=
np
.
load
(
mask
)
mask
=
np
.
load
(
mask
)
else
:
else
:
mask
=
np
.
fromfile
(
mask
,
dtype
=
np
.
long
)
mask
=
np
.
fromfile
(
mask
,
dtype
=
np
.
int64
)
label
=
self
.
cat_id2class
[
mask
]
label
=
self
.
cat_id2class
[
mask
]
return
label
return
label
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment