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
c2fe651f
Commit
c2fe651f
authored
Jul 20, 2022
by
zhangshilong
Committed by
ChaimZhu
Jul 20, 2022
Browse files
refactor directory
parent
bc5806ba
Changes
275
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
37 additions
and
227 deletions
+37
-227
tests/test_data/test_datasets/test_scannet_dataset.py
tests/test_data/test_datasets/test_scannet_dataset.py
+1
-1
tests/test_data/test_datasets/test_sunrgbd_dataset.py
tests/test_data/test_datasets/test_sunrgbd_dataset.py
+1
-1
tests/test_data/test_transforms/test_augs.py
tests/test_data/test_transforms/test_augs.py
+1
-1
tests/test_data/test_transforms/test_loading.py
tests/test_data/test_transforms/test_loading.py
+4
-4
tests/test_data/test_transforms/test_pack3d.py
tests/test_data/test_transforms/test_pack3d.py
+2
-2
tests/test_data/test_transforms/utils.py
tests/test_data/test_transforms/utils.py
+2
-2
tests/test_metrics/test_indoor_eval.py
tests/test_metrics/test_indoor_eval.py
+0
-188
tests/test_metrics/test_indoor_metric.py
tests/test_metrics/test_indoor_metric.py
+2
-2
tests/test_metrics/test_instance_seg_eval.py
tests/test_metrics/test_instance_seg_eval.py
+1
-1
tests/test_metrics/test_instance_seg_metric.py
tests/test_metrics/test_instance_seg_metric.py
+2
-2
tests/test_metrics/test_kitti_eval.py
tests/test_metrics/test_kitti_eval.py
+1
-2
tests/test_metrics/test_kitti_metric.py
tests/test_metrics/test_kitti_metric.py
+2
-3
tests/test_metrics/test_seg_eval.py
tests/test_metrics/test_seg_eval.py
+1
-1
tests/test_metrics/test_seg_metric.py
tests/test_metrics/test_seg_metric.py
+2
-2
tests/test_models/test_common_modules/test_dgcnn_modules.py
tests/test_models/test_common_modules/test_dgcnn_modules.py
+3
-3
tests/test_models/test_common_modules/test_paconv_modules.py
tests/test_models/test_common_modules/test_paconv_modules.py
+4
-4
tests/test_models/test_common_modules/test_paconv_ops.py
tests/test_models/test_common_modules/test_paconv_ops.py
+1
-1
tests/test_models/test_common_modules/test_pointnet_modules.py
.../test_models/test_common_modules/test_pointnet_modules.py
+3
-3
tests/test_models/test_common_modules/test_sparse_unet.py
tests/test_models/test_common_modules/test_sparse_unet.py
+3
-3
tests/test_models/test_common_modules/test_vote_module.py
tests/test_models/test_common_modules/test_vote_module.py
+1
-1
No files found.
tests/test_data/test_datasets/test_scannet_dataset.py
View file @
c2fe651f
...
@@ -5,8 +5,8 @@ import numpy as np
...
@@ -5,8 +5,8 @@ import numpy as np
import
torch
import
torch
from
mmengine.testing
import
assert_allclose
from
mmengine.testing
import
assert_allclose
from
mmdet3d.core
import
DepthInstance3DBoxes
from
mmdet3d.datasets
import
ScanNetDataset
,
ScanNetSegDataset
from
mmdet3d.datasets
import
ScanNetDataset
,
ScanNetSegDataset
from
mmdet3d.structures
import
DepthInstance3DBoxes
from
mmdet3d.utils
import
register_all_modules
from
mmdet3d.utils
import
register_all_modules
...
...
tests/test_data/test_datasets/test_sunrgbd_dataset.py
View file @
c2fe651f
...
@@ -5,8 +5,8 @@ import numpy as np
...
@@ -5,8 +5,8 @@ import numpy as np
import
torch
import
torch
from
mmengine.testing
import
assert_allclose
from
mmengine.testing
import
assert_allclose
from
mmdet3d.core
import
DepthInstance3DBoxes
from
mmdet3d.datasets
import
SUNRGBDDataset
from
mmdet3d.datasets
import
SUNRGBDDataset
from
mmdet3d.structures
import
DepthInstance3DBoxes
def
_generate_scannet_dataset_config
():
def
_generate_scannet_dataset_config
():
...
...
tests/test_data/test_transforms/test_augs.py
View file @
c2fe651f
...
@@ -8,7 +8,7 @@ from mmengine.testing import assert_allclose
...
@@ -8,7 +8,7 @@ from mmengine.testing import assert_allclose
from
utils
import
create_data_info_after_loading
from
utils
import
create_data_info_after_loading
from
mmdet3d.datasets
import
GlobalAlignment
,
RandomFlip3D
from
mmdet3d.datasets
import
GlobalAlignment
,
RandomFlip3D
from
mmdet3d.datasets.
pipeline
s
import
GlobalRotScaleTrans
from
mmdet3d.datasets.
transform
s
import
GlobalRotScaleTrans
class
TestGlobalRotScaleTrans
(
unittest
.
TestCase
):
class
TestGlobalRotScaleTrans
(
unittest
.
TestCase
):
...
...
tests/test_data/test_transforms/test_loading.py
View file @
c2fe651f
...
@@ -6,10 +6,10 @@ import torch
...
@@ -6,10 +6,10 @@ import torch
from
mmengine.testing
import
assert_allclose
from
mmengine.testing
import
assert_allclose
from
utils
import
create_dummy_data_info
from
utils
import
create_dummy_data_info
from
mmdet3d.core
import
DepthPoints
,
LiDARPoints
from
mmdet3d.datasets.transforms
import
PointSegClassMapping
from
mmdet3d.datasets.pipelines
import
PointSegClassMapping
from
mmdet3d.datasets.transforms.loading
import
(
LoadAnnotations3D
,
from
mmdet3d.datasets.pipelines.loading
import
(
LoadAnnotations3D
,
LoadPointsFromFile
)
LoadPointsFromFile
)
from
mmdet3d.structures
import
DepthPoints
,
LiDARPoints
class
TestLoadPointsFromFile
(
unittest
.
TestCase
):
class
TestLoadPointsFromFile
(
unittest
.
TestCase
):
...
...
tests/test_data/test_transforms/test_pack3d.py
View file @
c2fe651f
...
@@ -5,8 +5,8 @@ import torch
...
@@ -5,8 +5,8 @@ import torch
from
mmengine.testing
import
assert_allclose
from
mmengine.testing
import
assert_allclose
from
utils
import
create_data_info_after_loading
from
utils
import
create_data_info_after_loading
from
mmdet3d.
core
import
LiDARInstance3DBoxe
s
from
mmdet3d.
datasets.transforms.formating
import
Pack3DDetInput
s
from
mmdet3d.
datasets.pipelines.formating
import
Pack3DDetInput
s
from
mmdet3d.
structures
import
LiDARInstance3DBoxe
s
class
TestPack3DDetInputs
(
unittest
.
TestCase
):
class
TestPack3DDetInputs
(
unittest
.
TestCase
):
...
...
tests/test_data/test_transforms/utils.py
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) OpenMMLab. All rights reserved.
import
numpy
as
np
import
numpy
as
np
from
mmdet3d.core
import
LiDARInstance3DBoxes
# create a dummy `results` to test the pipeline
# create a dummy `results` to test the pipeline
from
mmdet3d.datasets
import
LoadAnnotations3D
,
LoadPointsFromFile
from
mmdet3d.datasets
import
LoadAnnotations3D
,
LoadPointsFromFile
from
mmdet3d.datasets.pipelines.loading
import
LoadImageFromFileMono3D
from
mmdet3d.datasets.transforms.loading
import
LoadImageFromFileMono3D
from
mmdet3d.structures
import
LiDARInstance3DBoxes
def
create_dummy_data_info
(
with_ann
=
True
):
def
create_dummy_data_info
(
with_ann
=
True
):
...
...
tests/test_metrics/test_indoor_eval.py
deleted
100644 → 0
View file @
bc5806ba
# Copyright (c) OpenMMLab. All rights reserved.
import
numpy
as
np
import
pytest
import
torch
from
mmdet3d.core.evaluation.indoor_eval
import
average_precision
,
indoor_eval
def
test_indoor_eval
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
from
mmdet3d.core.bbox.structures
import
Box3DMode
,
DepthInstance3DBoxes
det_infos
=
[{
'labels_3d'
:
torch
.
tensor
([
0
,
1
,
2
,
2
,
0
,
3
,
1
,
2
,
3
,
2
]),
'boxes_3d'
:
DepthInstance3DBoxes
(
torch
.
tensor
([[
-
2.4089e-03
,
-
3.3174e+00
,
4.9438e-01
,
2.1668e+00
,
2.8431e-01
,
1.6506e+00
,
0.0000e+00
],
[
-
3.4269e-01
,
-
2.7565e+00
,
2.8144e-02
,
6.8554e-01
,
9.6854e-01
,
6.1755e-01
,
0.0000e+00
],
[
-
3.8320e+00
,
-
1.0646e+00
,
1.7074e-01
,
2.4981e-01
,
4.4708e-01
,
6.2538e-01
,
0.0000e+00
],
[
4.1073e-01
,
3.3757e+00
,
3.4311e-01
,
8.0617e-01
,
2.8679e-01
,
1.6060e+00
,
0.0000e+00
],
[
6.1199e-01
,
-
3.1041e+00
,
4.1873e-01
,
1.2310e+00
,
4.0162e-01
,
1.7303e+00
,
0.0000e+00
],
[
-
5.9877e-01
,
-
2.6011e+00
,
1.1148e+00
,
1.5704e-01
,
7.5957e-01
,
9.6930e-01
,
0.0000e+00
],
[
2.7462e-01
,
-
3.0088e+00
,
6.5231e-02
,
8.1208e-01
,
4.1861e-01
,
3.7339e-01
,
0.0000e+00
],
[
-
1.4704e+00
,
-
2.0024e+00
,
2.7479e-01
,
1.7888e+00
,
1.0566e+00
,
1.3704e+00
,
0.0000e+00
],
[
8.2727e-02
,
-
3.1160e+00
,
2.5690e-01
,
1.4054e+00
,
2.0772e-01
,
9.6792e-01
,
0.0000e+00
],
[
2.6896e+00
,
1.9881e+00
,
1.1566e+00
,
9.9885e-02
,
3.5713e-01
,
4.5638e-01
,
0.0000e+00
]]),
origin
=
(
0.5
,
0.5
,
0
)),
'scores_3d'
:
torch
.
tensor
([
1.7516e-05
,
1.0167e-06
,
8.4486e-07
,
7.1048e-02
,
6.4274e-05
,
1.5003e-07
,
5.8102e-06
,
1.9399e-08
,
5.3126e-07
,
1.8630e-09
])
}]
label2cat
=
{
0
:
'cabinet'
,
1
:
'bed'
,
2
:
'chair'
,
3
:
'sofa'
,
}
gt_annos
=
[{
'gt_num'
:
10
,
'gt_boxes_upright_depth'
:
np
.
array
([[
-
2.4089e-03
,
-
3.3174e+00
,
4.9438e-01
,
2.1668e+00
,
2.8431e-01
,
1.6506e+00
,
0.0000e+00
],
[
-
3.4269e-01
,
-
2.7565e+00
,
2.8144e-02
,
6.8554e-01
,
9.6854e-01
,
6.1755e-01
,
0.0000e+00
],
[
-
3.8320e+00
,
-
1.0646e+00
,
1.7074e-01
,
2.4981e-01
,
4.4708e-01
,
6.2538e-01
,
0.0000e+00
],
[
4.1073e-01
,
3.3757e+00
,
3.4311e-01
,
8.0617e-01
,
2.8679e-01
,
1.6060e+00
,
0.0000e+00
],
[
6.1199e-01
,
-
3.1041e+00
,
4.1873e-01
,
1.2310e+00
,
4.0162e-01
,
1.7303e+00
,
0.0000e+00
],
[
-
5.9877e-01
,
-
2.6011e+00
,
1.1148e+00
,
1.5704e-01
,
7.5957e-01
,
9.6930e-01
,
0.0000e+00
],
[
2.7462e-01
,
-
3.0088e+00
,
6.5231e-02
,
8.1208e-01
,
4.1861e-01
,
3.7339e-01
,
0.0000e+00
],
[
-
1.4704e+00
,
-
2.0024e+00
,
2.7479e-01
,
1.7888e+00
,
1.0566e+00
,
1.3704e+00
,
0.0000e+00
],
[
8.2727e-02
,
-
3.1160e+00
,
2.5690e-01
,
1.4054e+00
,
2.0772e-01
,
9.6792e-01
,
0.0000e+00
],
[
2.6896e+00
,
1.9881e+00
,
1.1566e+00
,
9.9885e-02
,
3.5713e-01
,
4.5638e-01
,
0.0000e+00
]]),
'class'
:
np
.
array
([
0
,
1
,
2
,
0
,
0
,
3
,
1
,
3
,
3
,
2
])
}]
ret_value
=
indoor_eval
(
gt_annos
,
det_infos
,
[
0.25
,
0.5
],
label2cat
,
box_type_3d
=
DepthInstance3DBoxes
,
box_mode_3d
=
Box3DMode
.
DEPTH
)
assert
np
.
isclose
(
ret_value
[
'cabinet_AP_0.25'
],
0.666667
)
assert
np
.
isclose
(
ret_value
[
'bed_AP_0.25'
],
1.0
)
assert
np
.
isclose
(
ret_value
[
'chair_AP_0.25'
],
0.5
)
assert
np
.
isclose
(
ret_value
[
'mAP_0.25'
],
0.708333
)
assert
np
.
isclose
(
ret_value
[
'mAR_0.25'
],
0.833333
)
def
test_indoor_eval_less_classes
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
from
mmdet3d.core.bbox.structures
import
Box3DMode
,
DepthInstance3DBoxes
det_infos
=
[{
'labels_3d'
:
torch
.
tensor
([
0
]),
'boxes_3d'
:
DepthInstance3DBoxes
(
torch
.
tensor
([[
1.
,
1.
,
1.
,
1.
,
1.
,
1.
,
1.
]])),
'scores_3d'
:
torch
.
tensor
([.
5
])
},
{
'labels_3d'
:
torch
.
tensor
([
1
]),
'boxes_3d'
:
DepthInstance3DBoxes
(
torch
.
tensor
([[
1.
,
1.
,
1.
,
1.
,
1.
,
1.
,
1.
]])),
'scores_3d'
:
torch
.
tensor
([.
5
])
}]
label2cat
=
{
0
:
'cabinet'
,
1
:
'bed'
,
2
:
'chair'
}
gt_annos
=
[{
'gt_num'
:
2
,
'gt_boxes_upright_depth'
:
np
.
array
([[
0.
,
0.
,
0.
,
1.
,
1.
,
1.
,
1.
],
[
1.
,
1.
,
1.
,
1.
,
1.
,
1.
,
1.
]]),
'class'
:
np
.
array
([
2
,
0
])
},
{
'gt_num'
:
1
,
'gt_boxes_upright_depth'
:
np
.
array
([
[
1.
,
1.
,
1.
,
1.
,
1.
,
1.
,
1.
],
]),
'class'
:
np
.
array
([
1
])
}]
ret_value
=
indoor_eval
(
gt_annos
,
det_infos
,
[
0.25
,
0.5
],
label2cat
,
box_type_3d
=
DepthInstance3DBoxes
,
box_mode_3d
=
Box3DMode
.
DEPTH
)
assert
np
.
isclose
(
ret_value
[
'mAP_0.25'
],
0.666667
)
assert
np
.
isclose
(
ret_value
[
'mAR_0.25'
],
0.666667
)
def
test_average_precision
():
ap
=
average_precision
(
np
.
array
([[
0.25
,
0.5
,
0.75
],
[
0.25
,
0.5
,
0.75
]]),
np
.
array
([[
1.
,
1.
,
1.
],
[
1.
,
1.
,
1.
]]),
'11points'
)
assert
abs
(
ap
[
0
]
-
0.06611571
)
<
0.001
tests/test_metrics/test_indoor_metric.py
View file @
c2fe651f
...
@@ -5,8 +5,8 @@ from unittest.mock import patch
...
@@ -5,8 +5,8 @@ from unittest.mock import patch
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
from
mmdet3d.
core
import
DepthInstance3DBoxes
from
mmdet3d.
evaluation.metrics
import
IndoorMetric
from
mmdet3d.
metrics
import
IndoorMetric
from
mmdet3d.
structures
import
DepthInstance3DBoxes
class
TestIndoorMetric
(
unittest
.
TestCase
):
class
TestIndoorMetric
(
unittest
.
TestCase
):
...
...
tests/test_metrics/test_instance_seg_eval.py
View file @
c2fe651f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
from
mmdet3d.
core
import
instance_seg_eval
from
mmdet3d.
evaluation
import
instance_seg_eval
def
test_instance_seg_eval
():
def
test_instance_seg_eval
():
...
...
tests/test_metrics/test_instance_seg_metric.py
View file @
c2fe651f
...
@@ -5,8 +5,8 @@ import numpy as np
...
@@ -5,8 +5,8 @@ import numpy as np
import
torch
import
torch
from
mmengine.data
import
BaseDataElement
from
mmengine.data
import
BaseDataElement
from
mmdet3d.
core.data_structures
import
Det3DDataSample
,
PointData
from
mmdet3d.
evaluation.metrics
import
InstanceSegMetric
from
mmdet3d.
metrics
import
InstanceSegMetric
from
mmdet3d.
structures
import
Det3DDataSample
,
PointData
class
TestInstanceSegMetric
(
unittest
.
TestCase
):
class
TestInstanceSegMetric
(
unittest
.
TestCase
):
...
...
tests/test_metrics/test_kitti_eval.py
View file @
c2fe651f
...
@@ -3,8 +3,7 @@ import numpy as np
...
@@ -3,8 +3,7 @@ import numpy as np
import
pytest
import
pytest
import
torch
import
torch
from
mmdet3d.core.evaluation.kitti_utils.eval
import
(
do_eval
,
eval_class
,
from
mmdet3d.evaluation
import
do_eval
,
eval_class
,
kitti_eval
kitti_eval
)
def
test_do_eval
():
def
test_do_eval
():
...
...
tests/test_metrics/test_kitti_metric.py
View file @
c2fe651f
...
@@ -3,9 +3,8 @@ import pytest
...
@@ -3,9 +3,8 @@ import pytest
import
torch
import
torch
from
mmengine.data
import
InstanceData
from
mmengine.data
import
InstanceData
from
mmdet3d.core
import
Det3DDataSample
from
mmdet3d.evaluation.metrics
import
KittiMetric
from
mmdet3d.core.bbox
import
LiDARInstance3DBoxes
from
mmdet3d.structures
import
Det3DDataSample
,
LiDARInstance3DBoxes
from
mmdet3d.metrics
import
KittiMetric
data_root
=
'tests/data/kitti'
data_root
=
'tests/data/kitti'
...
...
tests/test_metrics/test_seg_eval.py
View file @
c2fe651f
...
@@ -3,7 +3,7 @@ import numpy as np
...
@@ -3,7 +3,7 @@ import numpy as np
import
pytest
import
pytest
import
torch
import
torch
from
mmdet3d.
core.
evaluation.seg_eval
import
seg_eval
from
mmdet3d.evaluation.
functional.
seg_eval
import
seg_eval
def
test_indoor_eval
():
def
test_indoor_eval
():
...
...
tests/test_metrics/test_seg_metric.py
View file @
c2fe651f
...
@@ -4,8 +4,8 @@ import unittest
...
@@ -4,8 +4,8 @@ import unittest
import
torch
import
torch
from
mmengine.data
import
BaseDataElement
from
mmengine.data
import
BaseDataElement
from
mmdet3d.
core.data_structures
import
Det3DDataSample
,
PointData
from
mmdet3d.
evaluation.metrics
import
SegMetric
from
mmdet3d.
metrics
import
SegMetric
from
mmdet3d.
structures
import
Det3DDataSample
,
PointData
class
TestSegMetric
(
unittest
.
TestCase
):
class
TestSegMetric
(
unittest
.
TestCase
):
...
...
tests/test_models/test_common_modules/test_dgcnn_modules.py
View file @
c2fe651f
...
@@ -7,7 +7,7 @@ import torch
...
@@ -7,7 +7,7 @@ import torch
def
test_dgcnn_gf_module
():
def
test_dgcnn_gf_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
DGCNNGFModule
from
mmdet3d.
models.layer
s
import
DGCNNGFModule
self
=
DGCNNGFModule
(
self
=
DGCNNGFModule
(
mlp_channels
=
[
18
,
64
,
64
],
mlp_channels
=
[
18
,
64
,
64
],
...
@@ -60,7 +60,7 @@ def test_dgcnn_gf_module():
...
@@ -60,7 +60,7 @@ def test_dgcnn_gf_module():
def
test_dgcnn_fa_module
():
def
test_dgcnn_fa_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
DGCNNFAModule
from
mmdet3d.
models.layer
s
import
DGCNNFAModule
self
=
DGCNNFAModule
(
mlp_channels
=
[
24
,
16
]).
cuda
()
self
=
DGCNNFAModule
(
mlp_channels
=
[
24
,
16
]).
cuda
()
assert
self
.
mlps
.
layer0
.
conv
.
in_channels
==
24
assert
self
.
mlps
.
layer0
.
conv
.
in_channels
==
24
...
@@ -75,7 +75,7 @@ def test_dgcnn_fa_module():
...
@@ -75,7 +75,7 @@ def test_dgcnn_fa_module():
def
test_dgcnn_fp_module
():
def
test_dgcnn_fp_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
DGCNNFPModule
from
mmdet3d.
models.layer
s
import
DGCNNFPModule
self
=
DGCNNFPModule
(
mlp_channels
=
[
24
,
16
]).
cuda
()
self
=
DGCNNFPModule
(
mlp_channels
=
[
24
,
16
]).
cuda
()
assert
self
.
mlps
.
layer0
.
conv
.
in_channels
==
24
assert
self
.
mlps
.
layer0
.
conv
.
in_channels
==
24
...
...
tests/test_models/test_common_modules/test_paconv_modules.py
View file @
c2fe651f
...
@@ -7,7 +7,7 @@ import torch
...
@@ -7,7 +7,7 @@ import torch
def
test_paconv_sa_module_msg
():
def
test_paconv_sa_module_msg
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
PAConvSAModuleMSG
from
mmdet3d.
models.layer
s
import
PAConvSAModuleMSG
# paconv_num_kernels should have same length as mlp_channels
# paconv_num_kernels should have same length as mlp_channels
with
pytest
.
raises
(
AssertionError
):
with
pytest
.
raises
(
AssertionError
):
...
@@ -105,7 +105,7 @@ def test_paconv_sa_module_msg():
...
@@ -105,7 +105,7 @@ def test_paconv_sa_module_msg():
def
test_paconv_sa_module
():
def
test_paconv_sa_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
build_sa_module
from
mmdet3d.
models.layer
s
import
build_sa_module
sa_cfg
=
dict
(
sa_cfg
=
dict
(
type
=
'PAConvSAModule'
,
type
=
'PAConvSAModule'
,
num_point
=
16
,
num_point
=
16
,
...
@@ -164,7 +164,7 @@ def test_paconv_sa_module():
...
@@ -164,7 +164,7 @@ def test_paconv_sa_module():
def
test_paconv_cuda_sa_module_msg
():
def
test_paconv_cuda_sa_module_msg
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
PAConvCUDASAModuleMSG
from
mmdet3d.
models.layer
s
import
PAConvCUDASAModuleMSG
# paconv_num_kernels should have same length as mlp_channels
# paconv_num_kernels should have same length as mlp_channels
with
pytest
.
raises
(
AssertionError
):
with
pytest
.
raises
(
AssertionError
):
...
@@ -245,7 +245,7 @@ def test_paconv_cuda_sa_module_msg():
...
@@ -245,7 +245,7 @@ def test_paconv_cuda_sa_module_msg():
def
test_paconv_cuda_sa_module
():
def
test_paconv_cuda_sa_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
build_sa_module
from
mmdet3d.
models.layer
s
import
build_sa_module
sa_cfg
=
dict
(
sa_cfg
=
dict
(
type
=
'PAConvCUDASAModule'
,
type
=
'PAConvCUDASAModule'
,
num_point
=
16
,
num_point
=
16
,
...
...
tests/test_models/test_common_modules/test_paconv_ops.py
View file @
c2fe651f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
pytest
import
pytest
import
torch
import
torch
from
mmdet3d.
op
s
import
PAConv
,
PAConvCUDA
from
mmdet3d.
models.layer
s
import
PAConv
,
PAConvCUDA
def
test_paconv
():
def
test_paconv
():
...
...
tests/test_models/test_common_modules/test_pointnet_modules.py
View file @
c2fe651f
...
@@ -7,7 +7,7 @@ import torch
...
@@ -7,7 +7,7 @@ import torch
def
test_pointnet_sa_module_msg
():
def
test_pointnet_sa_module_msg
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
PointSAModuleMSG
from
mmdet3d.
models.layer
s
import
PointSAModuleMSG
self
=
PointSAModuleMSG
(
self
=
PointSAModuleMSG
(
num_point
=
16
,
num_point
=
16
,
...
@@ -152,7 +152,7 @@ def test_pointnet_sa_module_msg():
...
@@ -152,7 +152,7 @@ def test_pointnet_sa_module_msg():
def
test_pointnet_sa_module
():
def
test_pointnet_sa_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
build_sa_module
from
mmdet3d.
models.layer
s
import
build_sa_module
sa_cfg
=
dict
(
sa_cfg
=
dict
(
type
=
'PointSAModule'
,
type
=
'PointSAModule'
,
num_point
=
16
,
num_point
=
16
,
...
@@ -211,7 +211,7 @@ def test_pointnet_sa_module():
...
@@ -211,7 +211,7 @@ def test_pointnet_sa_module():
def
test_pointnet_fp_module
():
def
test_pointnet_fp_module
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
()
pytest
.
skip
()
from
mmdet3d.
op
s
import
PointFPModule
from
mmdet3d.
models.layer
s
import
PointFPModule
self
=
PointFPModule
(
mlp_channels
=
[
24
,
16
]).
cuda
()
self
=
PointFPModule
(
mlp_channels
=
[
24
,
16
]).
cuda
()
assert
self
.
mlps
.
layer0
.
conv
.
in_channels
==
24
assert
self
.
mlps
.
layer0
.
conv
.
in_channels
==
24
...
...
tests/test_models/test_common_modules/test_sparse_unet.py
View file @
c2fe651f
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
import
pytest
import
pytest
import
torch
import
torch
from
mmdet3d.
op
s
import
SparseBasicBlock
from
mmdet3d.
models.layer
s
import
SparseBasicBlock
from
mmdet3d.
op
s.spconv
import
IS_SPCONV2_AVAILABLE
from
mmdet3d.
models.layer
s.spconv
import
IS_SPCONV2_AVAILABLE
if
IS_SPCONV2_AVAILABLE
:
if
IS_SPCONV2_AVAILABLE
:
from
spconv.pytorch
import
(
SparseConv3d
,
SparseConvTensor
,
from
spconv.pytorch
import
(
SparseConv3d
,
SparseConvTensor
,
...
@@ -97,7 +97,7 @@ def test_SparseBasicBlock():
...
@@ -97,7 +97,7 @@ def test_SparseBasicBlock():
def
test_make_sparse_convmodule
():
def
test_make_sparse_convmodule
():
if
not
torch
.
cuda
.
is_available
():
if
not
torch
.
cuda
.
is_available
():
pytest
.
skip
(
'test requires GPU and torch+cuda'
)
pytest
.
skip
(
'test requires GPU and torch+cuda'
)
from
mmdet3d.
op
s
import
make_sparse_convmodule
from
mmdet3d.
models.layer
s
import
make_sparse_convmodule
voxel_features
=
torch
.
tensor
(
voxel_features
=
torch
.
tensor
(
[[
6.56126
,
0.9648336
,
-
1.7339306
,
0.315
],
[[
6.56126
,
0.9648336
,
-
1.7339306
,
0.315
],
...
...
tests/test_models/test_common_modules/test_vote_module.py
View file @
c2fe651f
...
@@ -3,7 +3,7 @@ import torch
...
@@ -3,7 +3,7 @@ import torch
def
test_vote_module
():
def
test_vote_module
():
from
mmdet3d.models.
model_util
s
import
VoteModule
from
mmdet3d.models.
layer
s
import
VoteModule
vote_loss
=
dict
(
vote_loss
=
dict
(
type
=
'ChamferDistance'
,
type
=
'ChamferDistance'
,
...
...
Prev
1
…
8
9
10
11
12
13
14
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