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
vision
Commits
1d229b77
Commit
1d229b77
authored
Dec 19, 2019
by
Lara Haidar
Committed by
Francisco Massa
Dec 19, 2019
Browse files
Enable KeypointRCNN test (#1673)
parent
d32bce08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
test/test_onnx.py
test/test_onnx.py
+15
-3
No files found.
test/test_onnx.py
View file @
1d229b77
...
@@ -365,11 +365,23 @@ class ONNXExporterTester(unittest.TestCase):
...
@@ -365,11 +365,23 @@ class ONNXExporterTester(unittest.TestCase):
assert
torch
.
all
(
out2
[
0
].
eq
(
out_trace2
[
0
]))
assert
torch
.
all
(
out2
[
0
].
eq
(
out_trace2
[
0
]))
assert
torch
.
all
(
out2
[
1
].
eq
(
out_trace2
[
1
]))
assert
torch
.
all
(
out2
[
1
].
eq
(
out_trace2
[
1
]))
@
unittest
.
skip
(
"Disable test until Argmax is updated in ONNX"
)
def
test_keypoint_rcnn
(
self
):
def
test_keypoint_rcnn
(
self
):
images
,
test_images
=
self
.
get_test_images
()
class
KeyPointRCNN
(
torch
.
nn
.
Module
):
def
__init__
(
self
):
super
(
KeyPointRCNN
,
self
).
__init__
()
self
.
model
=
models
.
detection
.
keypoint_rcnn
.
keypointrcnn_resnet50_fpn
(
pretrained
=
True
,
min_size
=
200
,
max_size
=
300
)
def
forward
(
self
,
images
):
output
=
self
.
model
(
images
)
# TODO: The keypoints_scores require the use of Argmax that is updated in ONNX.
# For now we are testing all the output of KeypointRCNN except keypoints_scores.
# Enable When Argmax is updated in ONNX Runtime.
return
output
[
0
][
'boxes'
],
output
[
0
][
'labels'
],
output
[
0
][
'scores'
],
output
[
0
][
'keypoints'
]
model
=
models
.
detection
.
keypoint_rcnn
.
keypointrcnn_resnet50_fpn
(
pretrained
=
True
,
min_size
=
200
,
max_size
=
300
)
images
,
test_images
=
self
.
get_test_images
()
model
=
KeyPointRCNN
()
model
.
eval
()
model
.
eval
()
model
(
test_images
)
model
(
test_images
)
self
.
run_model
(
model
,
[(
images
,),
(
test_images
,)])
self
.
run_model
(
model
,
[(
images
,),
(
test_images
,)])
...
...
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