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
42c55c20
Unverified
Commit
42c55c20
authored
Oct 07, 2020
by
twang
Committed by
GitHub
Oct 07, 2020
Browse files
Add unittest for cam_box3d fixed init (#150)
parent
733df015
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
tests/test_box3d.py
tests/test_box3d.py
+9
-0
No files found.
tests/test_box3d.py
View file @
42c55c20
...
...
@@ -884,6 +884,15 @@ def test_camera_boxes3d():
# the pytorch print loses some precision
assert
torch
.
allclose
(
boxes
.
corners
,
expected_tensor
,
rtol
=
1e-4
,
atol
=
1e-7
)
# test init with a given origin
boxes_origin_given
=
CameraInstance3DBoxes
(
th_boxes
.
clone
(),
box_dim
=
7
,
origin
=
(
0.5
,
0.5
,
0.5
))
expected_tensor
=
th_boxes
.
clone
()
expected_tensor
[:,
:
3
]
=
th_boxes
[:,
:
3
]
+
th_boxes
[:,
3
:
6
]
*
(
th_boxes
.
new_tensor
((
0.5
,
1.0
,
0.5
))
-
th_boxes
.
new_tensor
(
(
0.5
,
0.5
,
0.5
)))
assert
torch
.
allclose
(
boxes_origin_given
.
tensor
,
expected_tensor
)
def
test_boxes3d_overlaps
():
"""Test the iou calculation of boxes in different modes.
...
...
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