Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
2c0d9fa8
Commit
2c0d9fa8
authored
Dec 16, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnn(test): fix Test_Model.Keypoints* tests
parent
ba7b0f4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
test_model.cpp
modules/dnn/test/test_model.cpp
+18
-3
No files found.
modules/dnn/test/test_model.cpp
View file @
2c0d9fa8
...
@@ -83,6 +83,9 @@ public:
...
@@ -83,6 +83,9 @@ public:
model
.
setInputSize
(
size
).
setInputMean
(
mean
).
setInputScale
(
scale
)
model
.
setInputSize
(
size
).
setInputMean
(
mean
).
setInputScale
(
scale
)
.
setInputSwapRB
(
swapRB
).
setInputCrop
(
crop
);
.
setInputSwapRB
(
swapRB
).
setInputCrop
(
crop
);
model
.
setPreferableBackend
(
backend
);
model
.
setPreferableTarget
(
target
);
points
=
model
.
estimate
(
frame
,
0.5
);
points
=
model
.
estimate
(
frame
,
0.5
);
Mat
out
=
Mat
(
points
).
reshape
(
1
);
Mat
out
=
Mat
(
points
).
reshape
(
1
);
...
@@ -242,8 +245,15 @@ TEST_P(Test_Model, DetectionMobilenetSSD)
...
@@ -242,8 +245,15 @@ TEST_P(Test_Model, DetectionMobilenetSSD)
TEST_P
(
Test_Model
,
Keypoints_pose
)
TEST_P
(
Test_Model
,
Keypoints_pose
)
{
{
if
(
target
==
DNN_TARGET_OPENCL_FP16
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_OPENCL_FP16
);
#ifdef HAVE_INF_ENGINE
if
(
target
==
DNN_TARGET_MYRIAD
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_MYRIAD
,
CV_TEST_TAG_DNN_SKIP_IE_VERSION
);
#endif
Mat
inp
=
imread
(
_tf
(
"pose.png"
));
Mat
inp
=
imread
(
_tf
(
"pose.png"
));
std
::
string
weights
=
_tf
(
"lightweight_pose_estimation.onnx"
);
std
::
string
weights
=
_tf
(
"
onnx/models/
lightweight_pose_estimation.onnx"
);
Mat
exp
=
blobFromNPY
(
_tf
(
"keypoints_exp.npy"
));
Mat
exp
=
blobFromNPY
(
_tf
(
"keypoints_exp.npy"
));
...
@@ -258,12 +268,17 @@ TEST_P(Test_Model, Keypoints_pose)
...
@@ -258,12 +268,17 @@ TEST_P(Test_Model, Keypoints_pose)
TEST_P
(
Test_Model
,
Keypoints_face
)
TEST_P
(
Test_Model
,
Keypoints_face
)
{
{
#if defined(INF_ENGINE_RELEASE)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019
)
applyTestTag
(
CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER
,
CV_TEST_TAG_DNN_SKIP_IE_VERSION
);
#endif
Mat
inp
=
imread
(
_tf
(
"gray_face.png"
),
0
);
Mat
inp
=
imread
(
_tf
(
"gray_face.png"
),
0
);
std
::
string
weights
=
_tf
(
"facial_keypoints.onnx"
);
std
::
string
weights
=
_tf
(
"
onnx/models/
facial_keypoints.onnx"
);
Mat
exp
=
blobFromNPY
(
_tf
(
"facial_keypoints_exp.npy"
));
Mat
exp
=
blobFromNPY
(
_tf
(
"facial_keypoints_exp.npy"
));
Size
size
{
224
,
224
};
Size
size
{
224
,
224
};
float
norm
=
1e-4
;
float
norm
=
(
target
==
DNN_TARGET_OPENCL_FP16
)
?
5e-3
:
1e-4
;
double
scale
=
1.0
/
255
;
double
scale
=
1.0
/
255
;
Scalar
mean
=
Scalar
();
Scalar
mean
=
Scalar
();
bool
swapRB
=
false
;
bool
swapRB
=
false
;
...
...
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