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
e90a8be6
"setup.cfg" did not exist on "ad08a792c00cf30ebea36e54b34fbf7a54dc7054"
Commit
e90a8be6
authored
May 10, 2020
by
liyinhao
Browse files
fix some problems
parent
fe799e0a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
20 deletions
+19
-20
mmdet3d/datasets/__init__.py
mmdet3d/datasets/__init__.py
+6
-6
mmdet3d/datasets/pipelines/__init__.py
mmdet3d/datasets/pipelines/__init__.py
+3
-2
mmdet3d/datasets/pipelines/indoor_sample.py
mmdet3d/datasets/pipelines/indoor_sample.py
+2
-2
tests/test_indoor_loading.py
tests/test_indoor_loading.py
+1
-1
tests/test_indoor_sample.py
tests/test_indoor_sample.py
+7
-9
No files found.
mmdet3d/datasets/__init__.py
View file @
e90a8be6
...
@@ -7,10 +7,10 @@ from .loader import DistributedGroupSampler, GroupSampler, build_dataloader
...
@@ -7,10 +7,10 @@ from .loader import DistributedGroupSampler, GroupSampler, build_dataloader
from
.nuscenes_dataset
import
NuScenesDataset
from
.nuscenes_dataset
import
NuScenesDataset
from
.pipelines
import
(
GlobalRotScale
,
IndoorFlipData
,
IndoorGlobalRotScale
,
from
.pipelines
import
(
GlobalRotScale
,
IndoorFlipData
,
IndoorGlobalRotScale
,
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
,
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
,
IndoorPoint
sColorJitter
,
IndoorPointsColor
Normalize
,
IndoorPoint
Sample
,
IndoorPointsColor
Jitter
,
ObjectNoise
,
ObjectRangeFilter
,
ObjectSampl
e
,
IndoorPointsColorNormalize
,
ObjectNois
e
,
Poin
tSample
,
PointShuffle
,
PointsRangeFilter
,
ObjectRangeFilter
,
Objec
tSample
,
PointShuffle
,
RandomFlip3D
)
PointsRangeFilter
,
RandomFlip3D
)
__all__
=
[
__all__
=
[
'KittiDataset'
,
'GroupSampler'
,
'DistributedGroupSampler'
,
'KittiDataset'
,
'GroupSampler'
,
'DistributedGroupSampler'
,
...
@@ -18,7 +18,7 @@ __all__ = [
...
@@ -18,7 +18,7 @@ __all__ = [
'CocoDataset'
,
'Kitti2DDataset'
,
'NuScenesDataset'
,
'ObjectSample'
,
'CocoDataset'
,
'Kitti2DDataset'
,
'NuScenesDataset'
,
'ObjectSample'
,
'RandomFlip3D'
,
'ObjectNoise'
,
'GlobalRotScale'
,
'PointShuffle'
,
'RandomFlip3D'
,
'ObjectNoise'
,
'GlobalRotScale'
,
'PointShuffle'
,
'ObjectRangeFilter'
,
'PointsRangeFilter'
,
'Collect3D'
,
'ObjectRangeFilter'
,
'PointsRangeFilter'
,
'Collect3D'
,
'IndoorLoadPointsFromFile'
,
'IndoorPointsColorNormalize'
,
'PointSample'
,
'IndoorLoadPointsFromFile'
,
'IndoorPointsColorNormalize'
,
'IndoorLoadAnnotations3D'
,
'IndoorPointsColorJitter'
,
'IndoorPointSample'
,
'IndoorLoadAnnotations3D'
,
'IndoorPointsColorJitter'
,
'IndoorGlobalRotScale'
,
'IndoorFlipData'
'IndoorGlobalRotScale'
,
'IndoorFlipData'
]
]
mmdet3d/datasets/pipelines/__init__.py
View file @
e90a8be6
...
@@ -5,7 +5,7 @@ from .indoor_augment import (IndoorFlipData, IndoorGlobalRotScale,
...
@@ -5,7 +5,7 @@ from .indoor_augment import (IndoorFlipData, IndoorGlobalRotScale,
IndoorPointsColorJitter
)
IndoorPointsColorJitter
)
from
.indoor_loading
import
(
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
,
from
.indoor_loading
import
(
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
,
IndoorPointsColorNormalize
)
IndoorPointsColorNormalize
)
from
.indoor_sample
import
PointSample
from
.indoor_sample
import
Indoor
PointSample
from
.loading
import
LoadMultiViewImageFromFiles
,
LoadPointsFromFile
from
.loading
import
LoadMultiViewImageFromFiles
,
LoadPointsFromFile
from
.train_aug
import
(
GlobalRotScale
,
ObjectNoise
,
ObjectRangeFilter
,
from
.train_aug
import
(
GlobalRotScale
,
ObjectNoise
,
ObjectRangeFilter
,
ObjectSample
,
PointShuffle
,
PointsRangeFilter
,
ObjectSample
,
PointShuffle
,
PointsRangeFilter
,
...
@@ -18,5 +18,6 @@ __all__ = [
...
@@ -18,5 +18,6 @@ __all__ = [
'DefaultFormatBundle'
,
'DefaultFormatBundle3D'
,
'DataBaseSampler'
,
'DefaultFormatBundle'
,
'DefaultFormatBundle3D'
,
'DataBaseSampler'
,
'IndoorGlobalRotScale'
,
'IndoorPointsColorJitter'
,
'IndoorFlipData'
,
'IndoorGlobalRotScale'
,
'IndoorPointsColorJitter'
,
'IndoorFlipData'
,
'MMDataBaseSampler'
,
'IndoorLoadPointsFromFile'
,
'MMDataBaseSampler'
,
'IndoorLoadPointsFromFile'
,
'IndoorPointsColorNormalize'
,
'IndoorLoadAnnotations3D'
,
'PointSample'
'IndoorPointsColorNormalize'
,
'IndoorLoadAnnotations3D'
,
'IndoorPointSample'
]
]
mmdet3d/datasets/pipelines/indoor_sample.py
View file @
e90a8be6
...
@@ -4,7 +4,7 @@ from mmdet.datasets.builder import PIPELINES
...
@@ -4,7 +4,7 @@ from mmdet.datasets.builder import PIPELINES
@
PIPELINES
.
register_module
()
@
PIPELINES
.
register_module
()
class
PointSample
(
object
):
class
Indoor
PointSample
(
object
):
"""Point Sample.
"""Point Sample.
Sampling data to a certain number.
Sampling data to a certain number.
...
@@ -46,7 +46,7 @@ class PointSample(object):
...
@@ -46,7 +46,7 @@ class PointSample(object):
return
points
[
choices
]
return
points
[
choices
]
def
__call__
(
self
,
results
):
def
__call__
(
self
,
results
):
points
=
results
.
get
(
'points'
,
None
)
points
=
results
[
'points'
]
points
,
choices
=
self
.
points_random_sampling
(
points
,
choices
=
self
.
points_random_sampling
(
points
,
self
.
num_points
,
return_choices
=
True
)
points
,
self
.
num_points
,
return_choices
=
True
)
pts_instance_mask
=
results
.
get
(
'pts_instance_mask'
,
None
)
pts_instance_mask
=
results
.
get
(
'pts_instance_mask'
,
None
)
...
...
tests/test_indoor_loading.py
View file @
e90a8be6
...
@@ -65,7 +65,7 @@ def test_load_annotations3D():
...
@@ -65,7 +65,7 @@ def test_load_annotations3D():
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'
)
scannet_results
[
'pts_semantic_mask_path'
]
=
osp
.
join
(
scannet_results
[
'pts_semantic_mask_path'
]
=
osp
.
join
(
data_path
,
scan_name
+
'
_sem_label.npy'
)
data_path
,
f
'
{
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_bboxes_3d'
]
=
scannet_gt_bboxes_3d
scannet_results
[
'gt_labels'
]
=
scannet_gt_labels
scannet_results
[
'gt_labels'
]
=
scannet_gt_labels
...
...
tests/test_indoor_sample.py
View file @
e90a8be6
import
numpy
as
np
import
numpy
as
np
from
mmdet3d.datasets.pipelines
import
PointSample
from
mmdet3d.datasets.pipelines
import
Indoor
PointSample
def
test_indoor_sample
():
def
test_indoor_sample
():
np
.
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
scannet_sample_points
=
PointSample
(
5
)
scannet_sample_points
=
Indoor
PointSample
(
5
)
scannet_results
=
dict
()
scannet_results
=
dict
()
scannet_points
=
np
.
array
([[
1.0719866
,
-
0.7870435
,
0.8408122
,
0.9196809
],
scannet_points
=
np
.
array
([[
1.0719866
,
-
0.7870435
,
0.8408122
,
0.9196809
],
[
1.103661
,
0.81065744
,
2.6616862
,
2.7405548
],
[
1.103661
,
0.81065744
,
2.6616862
,
2.7405548
],
...
@@ -24,11 +24,9 @@ def test_indoor_sample():
...
@@ -24,11 +24,9 @@ def test_indoor_sample():
scannet_pts_semantic_mask
=
np
.
array
([
38
,
1
,
1
,
40
,
0
,
40
,
1
,
1
,
1
,
0
])
scannet_pts_semantic_mask
=
np
.
array
([
38
,
1
,
1
,
40
,
0
,
40
,
1
,
1
,
1
,
0
])
scannet_results
[
'pts_semantic_mask'
]
=
scannet_pts_semantic_mask
scannet_results
[
'pts_semantic_mask'
]
=
scannet_pts_semantic_mask
scannet_results
=
scannet_sample_points
(
scannet_results
)
scannet_results
=
scannet_sample_points
(
scannet_results
)
scannet_points_result
=
scannet_results
.
get
(
'points'
,
None
)
scannet_points_result
=
scannet_results
[
'points'
]
scannet_instance_labels_result
=
scannet_results
.
get
(
scannet_instance_labels_result
=
scannet_results
[
'pts_instance_mask'
]
'pts_instance_mask'
,
None
)
scannet_semantic_labels_result
=
scannet_results
[
'pts_semantic_mask'
]
scannet_semantic_labels_result
=
scannet_results
.
get
(
'pts_semantic_mask'
,
None
)
scannet_choices
=
np
.
array
([
2
,
8
,
4
,
9
,
1
])
scannet_choices
=
np
.
array
([
2
,
8
,
4
,
9
,
1
])
assert
np
.
allclose
(
scannet_points
[
scannet_choices
],
scannet_points_result
)
assert
np
.
allclose
(
scannet_points
[
scannet_choices
],
scannet_points_result
)
assert
np
.
all
(
scannet_pts_instance_mask
[
scannet_choices
]
==
assert
np
.
all
(
scannet_pts_instance_mask
[
scannet_choices
]
==
...
@@ -37,7 +35,7 @@ def test_indoor_sample():
...
@@ -37,7 +35,7 @@ def test_indoor_sample():
scannet_semantic_labels_result
)
scannet_semantic_labels_result
)
np
.
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
sunrgbd_sample_points
=
PointSample
(
5
)
sunrgbd_sample_points
=
Indoor
PointSample
(
5
)
sunrgbd_results
=
dict
()
sunrgbd_results
=
dict
()
sunrgbd_point_cloud
=
np
.
array
(
sunrgbd_point_cloud
=
np
.
array
(
[[
-
1.8135729e-01
,
1.4695230e+00
,
-
1.2780589e+00
,
7.8938007e-03
],
[[
-
1.8135729e-01
,
1.4695230e+00
,
-
1.2780589e+00
,
7.8938007e-03
],
...
@@ -53,6 +51,6 @@ def test_indoor_sample():
...
@@ -53,6 +51,6 @@ def test_indoor_sample():
sunrgbd_results
[
'points'
]
=
sunrgbd_point_cloud
sunrgbd_results
[
'points'
]
=
sunrgbd_point_cloud
sunrgbd_results
=
sunrgbd_sample_points
(
sunrgbd_results
)
sunrgbd_results
=
sunrgbd_sample_points
(
sunrgbd_results
)
sunrgbd_choices
=
np
.
array
([
2
,
8
,
4
,
9
,
1
])
sunrgbd_choices
=
np
.
array
([
2
,
8
,
4
,
9
,
1
])
sunrgbd_points_result
=
sunrgbd_results
.
get
(
'points'
,
None
)
sunrgbd_points_result
=
sunrgbd_results
[
'points'
]
assert
np
.
allclose
(
sunrgbd_point_cloud
[
sunrgbd_choices
],
assert
np
.
allclose
(
sunrgbd_point_cloud
[
sunrgbd_choices
],
sunrgbd_points_result
)
sunrgbd_points_result
)
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