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
4283309d
Commit
4283309d
authored
Jul 23, 2018
by
Alexander Alekhin
Committed by
Dmitry Kurtaev
Jul 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnn: update tests for OpenVINO models
parent
6e767e23
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
19 deletions
+38
-19
test_ie_models.cpp
modules/dnn/test/test_ie_models.cpp
+37
-19
ts.hpp
modules/ts/include/opencv2/ts.hpp
+1
-0
No files found.
modules/dnn/test/test_ie_models.cpp
View file @
4283309d
...
...
@@ -13,15 +13,22 @@
#include <ie_icnn_network.hpp>
#include <ie_extension.h>
static
std
::
string
extraTestDataPath
=
#ifdef WINRT
NULL
;
#else
getenv
(
"INTEL_CVSDK_DIR"
);
#endif
namespace
opencv_test
{
namespace
{
static
void
initDLDTDataPath
()
{
#ifndef WINRT
static
bool
initialized
=
false
;
if
(
!
initialized
)
{
const
char
*
dldtTestDataPath
=
getenv
(
"INTEL_CVSDK_DIR"
);
if
(
dldtTestDataPath
)
cvtest
::
addDataSearchPath
(
cv
::
utils
::
fs
::
join
(
dldtTestDataPath
,
"deployment_tools"
));
initialized
=
true
;
}
#endif
}
using
namespace
cv
;
using
namespace
cv
::
dnn
;
using
namespace
InferenceEngine
;
...
...
@@ -174,13 +181,11 @@ TEST_P(DNNTestOpenVINO, models)
throw
SkipTestException
(
""
);
std
::
string
precision
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
"FP16"
:
"FP32"
;
std
::
string
prefix
=
utils
::
fs
::
join
(
extraTestDataPath
,
utils
::
fs
::
join
(
"deployment_tools"
,
utils
::
fs
::
join
(
"intel_models"
,
std
::
string
prefix
=
utils
::
fs
::
join
(
"intel_models"
,
utils
::
fs
::
join
(
modelName
,
utils
::
fs
::
join
(
precision
,
modelName
)))
))
;
std
::
string
xmlPath
=
prefix
+
".xml"
;
std
::
string
binPath
=
prefix
+
".bin"
;
utils
::
fs
::
join
(
precision
,
modelName
)));
std
::
string
xmlPath
=
findDataFile
(
prefix
+
".xml"
)
;
std
::
string
binPath
=
findDataFile
(
prefix
+
".bin"
)
;
std
::
map
<
std
::
string
,
cv
::
Mat
>
inputsMap
;
std
::
map
<
std
::
string
,
cv
::
Mat
>
ieOutputsMap
,
cvOutputsMap
;
...
...
@@ -199,17 +204,30 @@ TEST_P(DNNTestOpenVINO, models)
static
testing
::
internal
::
ParamGenerator
<
String
>
intelModels
()
{
String
path
=
utils
::
fs
::
join
(
utils
::
fs
::
join
(
extraTestDataPath
,
"deployment_tools"
),
"intel_models"
);
initDLDTDataPath
();
std
::
vector
<
String
>
modelsNames
;
std
::
string
path
;
try
{
path
=
findDataDirectory
(
"intel_models"
,
false
);
}
catch
(...)
{
std
::
cerr
<<
"ERROR: Can't find OpenVINO models. Check INTEL_CVSDK_DIR environment variable (run setup.sh)"
<<
std
::
endl
;
return
ValuesIn
(
modelsNames
);
// empty list
}
cv
::
utils
::
fs
::
glob_relative
(
path
,
""
,
modelsNames
,
false
,
true
);
std
::
vector
<
String
>::
iterator
end
=
modelsNames
.
erase
(
std
::
remove_if
(
modelsNames
.
begin
(),
modelsNames
.
end
(),
[
&
](
const
String
&
dir
){
return
!
utils
::
fs
::
isDirectory
(
utils
::
fs
::
join
(
path
,
dir
));
});
modelsNames
=
std
::
vector
<
String
>
(
modelsNames
.
begin
(),
end
);
[
&
](
const
String
&
dir
){
return
!
utils
::
fs
::
isDirectory
(
utils
::
fs
::
join
(
path
,
dir
));
}),
modelsNames
.
end
()
);
CV_Assert
(
!
modelsNames
.
empty
());
return
testing
::
ValuesIn
(
modelsNames
);
return
ValuesIn
(
modelsNames
);
}
INSTANTIATE_TEST_CASE_P
(
/**/
,
DNNTestOpenVINO
,
Combine
(
...
...
modules/ts/include/opencv2/ts.hpp
View file @
4283309d
...
...
@@ -103,6 +103,7 @@ using std::pair;
using
std
::
make_pair
;
using
testing
::
TestWithParam
;
using
testing
::
Values
;
using
testing
::
ValuesIn
;
using
testing
::
Combine
;
using
cv
::
Mat
;
...
...
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