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
d7a11228
Unverified
Commit
d7a11228
authored
Sep 24, 2020
by
yinchimaoliang
Committed by
GitHub
Sep 24, 2020
Browse files
[fix]:fix bug in dcn unittest (#130)
* Add version assert in init file. * Fix bug in test_dcn_head.
parent
4996f4cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
tests/test_heads.py
tests/test_heads.py
+17
-15
No files found.
tests/test_heads.py
View file @
d7a11228
...
...
@@ -46,8 +46,8 @@ def _get_config_module(fname):
def
_get_head_cfg
(
fname
):
"""Grab configs necessary to create a bbox_head.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
"""
import
mmcv
config
=
_get_config_module
(
fname
)
...
...
@@ -64,8 +64,8 @@ def _get_head_cfg(fname):
def
_get_rpn_head_cfg
(
fname
):
"""Grab configs necessary to create a rpn_head.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
"""
import
mmcv
config
=
_get_config_module
(
fname
)
...
...
@@ -82,8 +82,8 @@ def _get_rpn_head_cfg(fname):
def
_get_roi_head_cfg
(
fname
):
"""Grab configs necessary to create a roi_head.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
"""
import
mmcv
config
=
_get_config_module
(
fname
)
...
...
@@ -100,8 +100,8 @@ def _get_roi_head_cfg(fname):
def
_get_pts_bbox_head_cfg
(
fname
):
"""Grab configs necessary to create a pts_bbox_head.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
"""
import
mmcv
config
=
_get_config_module
(
fname
)
...
...
@@ -118,8 +118,8 @@ def _get_pts_bbox_head_cfg(fname):
def
_get_vote_head_cfg
(
fname
):
"""Grab configs necessary to create a vote_head.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
"""
import
mmcv
config
=
_get_config_module
(
fname
)
...
...
@@ -136,8 +136,8 @@ def _get_vote_head_cfg(fname):
def
_get_parta2_bbox_head_cfg
(
fname
):
"""Grab configs necessary to create a parta2_bbox_head.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
These are deep copied to allow for safe modification of parameters
without
influencing other tests.
"""
config
=
_get_config_module
(
fname
)
model
=
copy
.
deepcopy
(
config
.
model
)
...
...
@@ -780,7 +780,6 @@ def test_dcn_center_head():
voxel_size
=
[
0.2
,
0.2
,
8
]
dcn_center_head_cfg
=
dict
(
type
=
'CenterHead'
,
mode
=
'3d'
,
in_channels
=
sum
([
128
,
128
,
128
]),
tasks
=
[
dict
(
num_class
=
1
,
class_names
=
[
'car'
]),
...
...
@@ -868,8 +867,11 @@ def test_dcn_center_head():
gt_bboxes_3d
=
[
gt_bboxes_0
,
gt_bboxes_1
]
gt_labels_3d
=
[
gt_labels_0
,
gt_labels_1
]
loss
=
dcn_center_head
.
loss
(
gt_bboxes_3d
,
gt_labels_3d
,
output
)
loss_sum
=
torch
.
sum
(
torch
.
stack
([
item
for
_
,
item
in
loss
.
items
()]))
assert
torch
.
isclose
(
loss_sum
,
torch
.
tensor
(
21972.1230
))
for
key
,
item
in
loss
.
items
():
if
'heatmap'
in
key
:
assert
item
>=
0
else
:
assert
torch
.
sum
(
item
)
>=
0
# test get_bboxes
img_metas
=
[
...
...
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