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
51fa14c2
"...pytorch/rgcn/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "668bd928fe75c3eed33597790197d72176d9b731"
Commit
51fa14c2
authored
May 08, 2020
by
liyinhao
Browse files
change name, add new color module
parent
cda6a1a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
18 deletions
+31
-18
mmdet3d/datasets/pipelines/indoor_loading.py
mmdet3d/datasets/pipelines/indoor_loading.py
+5
-12
tests/data/sunrgbd/sunrgbd_infos.pkl
tests/data/sunrgbd/sunrgbd_infos.pkl
+0
-0
tests/data/sunrgbd/sunrgbd_trainval/lidar/000001.npy
tests/data/sunrgbd/sunrgbd_trainval/lidar/000001.npy
+0
-0
tests/test_indoor_loading.py
tests/test_indoor_loading.py
+26
-6
No files found.
mmdet3d/datasets/pipelines/indoor_loading.py
View file @
51fa14c2
...
@@ -25,6 +25,11 @@ class PointsColorNormalize(object):
...
@@ -25,6 +25,11 @@ class PointsColorNormalize(object):
results
[
'points'
]
=
points
results
[
'points'
]
=
points
return
results
return
results
def
__repr__
(
self
):
repr_str
=
self
.
__class__
.
__name__
repr_str
+=
'(color_mean={})'
.
format
(
self
.
color_mean
)
return
repr_str
@
PIPELINES
.
register_module
()
@
PIPELINES
.
register_module
()
class
LoadPointsFromFile
(
object
):
class
LoadPointsFromFile
(
object
):
...
@@ -82,15 +87,6 @@ class LoadAnnotations3D(object):
...
@@ -82,15 +87,6 @@ class LoadAnnotations3D(object):
def
__call__
(
self
,
results
):
def
__call__
(
self
,
results
):
ins_labelname
=
results
.
get
(
'ins_labelname'
,
None
)
ins_labelname
=
results
.
get
(
'ins_labelname'
,
None
)
sem_labelname
=
results
.
get
(
'sem_labelname'
,
None
)
sem_labelname
=
results
.
get
(
'sem_labelname'
,
None
)
info
=
results
.
get
(
'info'
,
None
)
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
]
gt_labels
=
info
[
'annos'
][
'class'
].
reshape
(
-
1
,
1
)
gt_bboxes_3d_mask
=
np
.
ones_like
(
gt_labels
)
else
:
gt_bboxes_3d
=
np
.
zeros
((
1
,
6
),
dtype
=
np
.
float32
)
gt_labels
=
np
.
zeros
((
1
,
1
))
gt_bboxes_3d_mask
=
np
.
zeros
((
1
,
1
))
if
ins_labelname
is
not
None
and
sem_labelname
is
not
None
:
if
ins_labelname
is
not
None
and
sem_labelname
is
not
None
:
assert
osp
.
exists
(
ins_labelname
)
assert
osp
.
exists
(
ins_labelname
)
...
@@ -100,9 +96,6 @@ class LoadAnnotations3D(object):
...
@@ -100,9 +96,6 @@ class LoadAnnotations3D(object):
results
[
'pts_instance_mask'
]
=
pts_instance_mask
results
[
'pts_instance_mask'
]
=
pts_instance_mask
results
[
'pts_semantic_mask'
]
=
pts_semantic_mask
results
[
'pts_semantic_mask'
]
=
pts_semantic_mask
results
[
'gt_bboxes_3d'
]
=
gt_bboxes_3d
results
[
'gt_labels'
]
=
gt_labels
results
[
'gt_bboxes_3d_mask'
]
=
gt_bboxes_3d_mask
return
results
return
results
def
__repr__
(
self
):
def
__repr__
(
self
):
...
...
tests/data/sunrgbd/sunrgbd_infos.pkl
0 → 100644
View file @
51fa14c2
File added
tests/data/sunrgbd/sunrgbd_trainval/lidar/000001.npy
0 → 100644
View file @
51fa14c2
File added
tests/test_indoor_loading.py
View file @
51fa14c2
import
os.path
as
osp
import
os.path
as
osp
import
mmcv
import
mmcv
import
numpy
as
np
from
mmdet3d.datasets.pipelines.indoor_loading
import
(
LoadAnnotations3D
,
from
mmdet3d.datasets.pipelines.indoor_loading
import
(
LoadAnnotations3D
,
LoadPointsFromFile
)
LoadPointsFromFile
)
...
@@ -13,7 +14,6 @@ def test_load_points_from_file():
...
@@ -13,7 +14,6 @@ def test_load_points_from_file():
data_path
=
'./tests/data/sunrgbd/sunrgbd_trainval'
data_path
=
'./tests/data/sunrgbd/sunrgbd_trainval'
sunrgbd_info
=
sunrgbd_info
[
0
]
sunrgbd_info
=
sunrgbd_info
[
0
]
scan_name
=
sunrgbd_info
[
'point_cloud'
][
'lidar_idx'
]
scan_name
=
sunrgbd_info
[
'point_cloud'
][
'lidar_idx'
]
sunrgbd_results
[
'info'
]
=
sunrgbd_info
sunrgbd_results
[
'pts_filename'
]
=
osp
.
join
(
data_path
,
'lidar'
,
sunrgbd_results
[
'pts_filename'
]
=
osp
.
join
(
data_path
,
'lidar'
,
'%06d.npy'
%
scan_name
)
'%06d.npy'
%
scan_name
)
sunrgbd_results
=
sunrgbd_load_points_from_file
(
sunrgbd_results
)
sunrgbd_results
=
sunrgbd_load_points_from_file
(
sunrgbd_results
)
...
@@ -27,7 +27,7 @@ def test_load_points_from_file():
...
@@ -27,7 +27,7 @@ def test_load_points_from_file():
scannet_results
[
'data_path'
]
=
data_path
scannet_results
[
'data_path'
]
=
data_path
scannet_info
=
scannet_info
[
0
]
scannet_info
=
scannet_info
[
0
]
scan_name
=
scannet_info
[
'point_cloud'
][
'lidar_idx'
]
scan_name
=
scannet_info
[
'point_cloud'
][
'lidar_idx'
]
scannet_results
[
'info'
]
=
scannet_info
scannet_results
[
'pts_filename'
]
=
osp
.
join
(
data_path
,
scannet_results
[
'pts_filename'
]
=
osp
.
join
(
data_path
,
scan_name
+
'_vert.npy'
)
scan_name
+
'_vert.npy'
)
scannet_results
=
scannet_load_data
(
scannet_results
)
scannet_results
=
scannet_load_data
(
scannet_results
)
...
@@ -36,10 +36,20 @@ def test_load_points_from_file():
...
@@ -36,10 +36,20 @@ def test_load_points_from_file():
def
test_load_annotations3D
():
def
test_load_annotations3D
():
sunrgbd_info
=
mmcv
.
load
(
'./tests/data/sunrgbd/sunrgbd_infos.pkl'
)
sunrgbd_info
=
mmcv
.
load
(
'./tests/data/sunrgbd/sunrgbd_infos.pkl'
)
[
0
]
sunrgbd_load_annotations3D
=
LoadAnnotations3D
()
sunrgbd_load_annotations3D
=
LoadAnnotations3D
()
sunrgbd_results
=
dict
()
sunrgbd_results
=
dict
()
sunrgbd_results
[
'info'
]
=
sunrgbd_info
[
0
]
if
sunrgbd_info
[
'annos'
][
'gt_num'
]
!=
0
:
sunrgbd_gt_bboxes_3d
=
sunrgbd_info
[
'annos'
][
'gt_boxes_upright_depth'
]
sunrgbd_gt_labels
=
sunrgbd_info
[
'annos'
][
'class'
].
reshape
(
-
1
,
1
)
sunrgbd_gt_bboxes_3d_mask
=
np
.
ones_like
(
sunrgbd_gt_labels
)
else
:
sunrgbd_gt_bboxes_3d
=
np
.
zeros
((
1
,
6
),
dtype
=
np
.
float32
)
sunrgbd_gt_labels
=
np
.
zeros
((
1
,
1
))
sunrgbd_gt_bboxes_3d_mask
=
np
.
zeros
((
1
,
1
))
sunrgbd_results
[
'gt_bboxes_3d'
]
=
sunrgbd_gt_bboxes_3d
sunrgbd_results
[
'gt_labels'
]
=
sunrgbd_gt_labels
sunrgbd_results
[
'gt_bboxes_3d_mask'
]
=
sunrgbd_gt_bboxes_3d_mask
sunrgbd_results
=
sunrgbd_load_annotations3D
(
sunrgbd_results
)
sunrgbd_results
=
sunrgbd_load_annotations3D
(
sunrgbd_results
)
sunrgbd_gt_boxes
=
sunrgbd_results
.
get
(
'gt_bboxes_3d'
,
None
)
sunrgbd_gt_boxes
=
sunrgbd_results
.
get
(
'gt_bboxes_3d'
,
None
)
sunrgbd_gt_lbaels
=
sunrgbd_results
.
get
(
'gt_labels'
,
None
)
sunrgbd_gt_lbaels
=
sunrgbd_results
.
get
(
'gt_labels'
,
None
)
...
@@ -48,17 +58,27 @@ def test_load_annotations3D():
...
@@ -48,17 +58,27 @@ def test_load_annotations3D():
assert
sunrgbd_gt_lbaels
.
shape
==
(
3
,
1
)
assert
sunrgbd_gt_lbaels
.
shape
==
(
3
,
1
)
assert
sunrgbd_gt_boxes_mask
.
shape
==
(
3
,
1
)
assert
sunrgbd_gt_boxes_mask
.
shape
==
(
3
,
1
)
scannet_info
=
mmcv
.
load
(
'./tests/data/scannet/scannet_infos.pkl'
)
scannet_info
=
mmcv
.
load
(
'./tests/data/scannet/scannet_infos.pkl'
)
[
0
]
scannet_load_annotations3D
=
LoadAnnotations3D
()
scannet_load_annotations3D
=
LoadAnnotations3D
()
scannet_results
=
dict
()
scannet_results
=
dict
()
data_path
=
'./tests/data/scannet/scannet_train_instance_data'
data_path
=
'./tests/data/scannet/scannet_train_instance_data'
scannet_info
=
scannet_info
[
0
]
if
scannet_info
[
'annos'
][
'gt_num'
]
!=
0
:
scannet_gt_bboxes_3d
=
scannet_info
[
'annos'
][
'gt_boxes_upright_depth'
]
scannet_gt_labels
=
scannet_info
[
'annos'
][
'class'
].
reshape
(
-
1
,
1
)
scannet_gt_bboxes_3d_mask
=
np
.
ones_like
(
scannet_gt_labels
)
else
:
scannet_gt_bboxes_3d
=
np
.
zeros
((
1
,
6
),
dtype
=
np
.
float32
)
scannet_gt_labels
=
np
.
zeros
((
1
,
1
))
scannet_gt_bboxes_3d_mask
=
np
.
zeros
((
1
,
1
))
scan_name
=
scannet_info
[
'point_cloud'
][
'lidar_idx'
]
scan_name
=
scannet_info
[
'point_cloud'
][
'lidar_idx'
]
scannet_results
[
'ins_labelname'
]
=
osp
.
join
(
data_path
,
scannet_results
[
'ins_labelname'
]
=
osp
.
join
(
data_path
,
scan_name
+
'_ins_label.npy'
)
scan_name
+
'_ins_label.npy'
)
scannet_results
[
'sem_labelname'
]
=
osp
.
join
(
data_path
,
scannet_results
[
'sem_labelname'
]
=
osp
.
join
(
data_path
,
scan_name
+
'_sem_label.npy'
)
scan_name
+
'_sem_label.npy'
)
scannet_results
[
'info'
]
=
scannet_info
scannet_results
[
'info'
]
=
scannet_info
scannet_results
[
'gt_bboxes_3d'
]
=
scannet_gt_bboxes_3d
scannet_results
[
'gt_labels'
]
=
scannet_gt_labels
scannet_results
[
'gt_bboxes_3d_mask'
]
=
scannet_gt_bboxes_3d_mask
scannet_results
=
scannet_load_annotations3D
(
scannet_results
)
scannet_results
=
scannet_load_annotations3D
(
scannet_results
)
scannet_gt_boxes
=
scannet_results
.
get
(
'gt_bboxes_3d'
,
None
)
scannet_gt_boxes
=
scannet_results
.
get
(
'gt_bboxes_3d'
,
None
)
scannet_gt_lbaels
=
scannet_results
.
get
(
'gt_labels'
,
None
)
scannet_gt_lbaels
=
scannet_results
.
get
(
'gt_labels'
,
None
)
...
...
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