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
94bbd751
Commit
94bbd751
authored
May 10, 2020
by
liyinhao
Browse files
merge master
parents
f201ba68
84569a41
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
4 deletions
+34
-4
tests/test_indoor_sample.py
tests/test_indoor_sample.py
+1
-1
tests/test_roi_extractors.py
tests/test_roi_extractors.py
+30
-0
tools/data_converter/sunrgbd_data_utils.py
tools/data_converter/sunrgbd_data_utils.py
+3
-3
No files found.
tests/test_indoor_sample.py
View file @
94bbd751
import
numpy
as
np
import
numpy
as
np
from
mmdet3d.datasets.pipelines
.indoor_sample
import
PointSample
from
mmdet3d.datasets.pipelines
import
PointSample
def
test_indoor_sample
():
def
test_indoor_sample
():
...
...
tests/test_roi_extractors.py
0 → 100644
View file @
94bbd751
import
pytest
import
torch
from
mmdet3d.models.roi_heads.roi_extractors
import
Single3DRoIAwareExtractor
def
test_single_roiaware_extractor
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
(
'test requires GPU and torch+cuda'
)
roi_layer_cfg
=
dict
(
type
=
'RoIAwarePool3d'
,
out_size
=
4
,
max_pts_per_voxel
=
128
,
mode
=
'max'
)
self
=
Single3DRoIAwareExtractor
(
roi_layer
=
roi_layer_cfg
)
feats
=
torch
.
tensor
(
[[
1
,
2
,
3.3
],
[
1.2
,
2.5
,
3.0
],
[
0.8
,
2.1
,
3.5
],
[
1.6
,
2.6
,
3.6
],
[
0.8
,
1.2
,
3.9
],
[
-
9.2
,
21.0
,
18.2
],
[
3.8
,
7.9
,
6.3
],
[
4.7
,
3.5
,
-
12.2
],
[
3.8
,
7.6
,
-
2
],
[
-
10.6
,
-
12.9
,
-
20
],
[
-
16
,
-
18
,
9
],
[
-
21.3
,
-
52
,
-
5
],
[
0
,
0
,
0
],
[
6
,
7
,
8
],
[
-
2
,
-
3
,
-
4
]],
dtype
=
torch
.
float32
).
cuda
()
coordinate
=
feats
.
clone
()
batch_inds
=
torch
.
zeros
(
feats
.
shape
[
0
]).
cuda
()
rois
=
torch
.
tensor
([[
0
,
1.0
,
2.0
,
3.0
,
4.0
,
5.0
,
6.0
,
0.3
],
[
0
,
-
10.0
,
23.0
,
16.0
,
10
,
20
,
20
,
0.5
]],
dtype
=
torch
.
float32
).
cuda
()
# test forward
pooled_feats
=
self
(
feats
,
coordinate
,
batch_inds
,
rois
)
assert
pooled_feats
.
shape
==
torch
.
Size
([
2
,
4
,
4
,
4
,
3
])
assert
torch
.
allclose
(
pooled_feats
.
sum
(),
torch
.
tensor
(
51.100
).
cuda
(),
1e-3
)
tools/data_converter/sunrgbd_data_utils.py
View file @
94bbd751
...
@@ -146,9 +146,9 @@ class SUNRGBDData(object):
...
@@ -146,9 +146,9 @@ class SUNRGBDData(object):
pc_upright_depth
=
self
.
get_depth
(
sample_idx
)
pc_upright_depth
=
self
.
get_depth
(
sample_idx
)
pc_upright_depth_subsampled
=
random_sampling
(
pc_upright_depth_subsampled
=
random_sampling
(
pc_upright_depth
,
SAMPLE_NUM
)
pc_upright_depth
,
SAMPLE_NUM
)
np
.
save
z_compressed
(
np
.
save
(
os
.
path
.
join
(
self
.
root_dir
,
'lidar'
,
f
'
{
sample_idx
:
06
d
}
.np
z
'
),
os
.
path
.
join
(
self
.
root_dir
,
'lidar'
,
f
'
{
sample_idx
:
06
d
}
.np
y
'
),
pc
=
pc_upright_depth_subsampled
)
pc_upright_depth_subsampled
)
info
=
dict
()
info
=
dict
()
pc_info
=
{
'num_features'
:
6
,
'lidar_idx'
:
sample_idx
}
pc_info
=
{
'num_features'
:
6
,
'lidar_idx'
:
sample_idx
}
...
...
Prev
1
2
Next
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