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
15e9e330
Commit
15e9e330
authored
Sep 18, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12579 from dkurt:dnn_reset_myriad_device
parents
3961b214
8ac7b217
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
+28
-3
dnn.hpp
modules/dnn/include/opencv2/dnn/dnn.hpp
+7
-0
op_inf_engine.cpp
modules/dnn/src/op_inf_engine.cpp
+12
-1
test_ie_models.cpp
modules/dnn/test/test_ie_models.cpp
+9
-2
No files found.
modules/dnn/include/opencv2/dnn/dnn.hpp
View file @
15e9e330
...
...
@@ -944,6 +944,13 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
CV_OUT
std
::
vector
<
int
>&
indices
,
const
float
eta
=
1.
f
,
const
int
top_k
=
0
);
/** @brief Release a Myriad device is binded by OpenCV.
*
* Single Myriad device cannot be shared across multiple processes which uses
* Inference Engine's Myriad plugin.
*/
CV_EXPORTS_W
void
resetMyriadDevice
();
//! @}
CV__DNN_EXPERIMENTAL_NS_END
}
...
...
modules/dnn/src/op_inf_engine.cpp
View file @
15e9e330
...
...
@@ -443,13 +443,14 @@ void InfEngineBackendNet::init(int targetId)
initPlugin
(
*
this
);
}
static
std
::
map
<
InferenceEngine
::
TargetDevice
,
InferenceEngine
::
InferenceEnginePluginPtr
>
sharedPlugins
;
void
InfEngineBackendNet
::
initPlugin
(
InferenceEngine
::
ICNNNetwork
&
net
)
{
CV_Assert
(
!
isInitialized
());
try
{
static
std
::
map
<
InferenceEngine
::
TargetDevice
,
InferenceEngine
::
InferenceEnginePluginPtr
>
sharedPlugins
;
auto
pluginIt
=
sharedPlugins
.
find
(
targetDevice
);
if
(
pluginIt
!=
sharedPlugins
.
end
())
{
...
...
@@ -589,4 +590,14 @@ void forwardInfEngine(Ptr<BackendNode>& node)
#endif // HAVE_INF_ENGINE
}
CV__DNN_EXPERIMENTAL_NS_BEGIN
void
resetMyriadDevice
()
{
#ifdef HAVE_INF_ENGINE
sharedPlugins
.
erase
(
InferenceEngine
::
TargetDevice
::
eMYRIAD
);
#endif // HAVE_INF_ENGINE
}
CV__DNN_EXPERIMENTAL_NS_END
}}
// namespace dnn, namespace cv
modules/dnn/test/test_ie_models.cpp
View file @
15e9e330
...
...
@@ -177,6 +177,11 @@ TEST_P(DNNTestOpenVINO, models)
Target
target
=
(
dnn
::
Target
)(
int
)
get
<
0
>
(
GetParam
());
std
::
string
modelName
=
get
<
1
>
(
GetParam
());
if
(
target
==
DNN_TARGET_MYRIAD
&&
(
modelName
==
"landmarks-regression-retail-0001"
||
modelName
==
"semantic-segmentation-adas-0001"
||
modelName
==
"face-reidentification-retail-0001"
))
throw
SkipTestException
(
""
);
std
::
string
precision
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
"FP16"
:
"FP32"
;
std
::
string
prefix
=
utils
::
fs
::
join
(
"intel_models"
,
utils
::
fs
::
join
(
modelName
,
...
...
@@ -186,6 +191,8 @@ TEST_P(DNNTestOpenVINO, models)
std
::
map
<
std
::
string
,
cv
::
Mat
>
inputsMap
;
std
::
map
<
std
::
string
,
cv
::
Mat
>
ieOutputsMap
,
cvOutputsMap
;
// Single Myriad device cannot be shared across multiple processes.
resetMyriadDevice
();
runIE
(
target
,
xmlPath
,
binPath
,
inputsMap
,
ieOutputsMap
);
runCV
(
target
,
xmlPath
,
binPath
,
inputsMap
,
cvOutputsMap
);
...
...
@@ -238,8 +245,8 @@ static testing::internal::ParamGenerator<Target> dnnDLIETargets()
targets
.
push_back
(
DNN_TARGET_OPENCL_FP16
);
}
#endif
//
if (checkMyriadTarget())
//
targets.push_back(DNN_TARGET_MYRIAD);
if
(
checkMyriadTarget
())
targets
.
push_back
(
DNN_TARGET_MYRIAD
);
return
testing
::
ValuesIn
(
targets
);
}
...
...
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