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
c2519151
Commit
c2519151
authored
Jun 26, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14895 from alalek:dnn_ie_extensions_path
parents
41128668
333e51b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
16 deletions
+36
-16
op_inf_engine.cpp
modules/dnn/src/op_inf_engine.cpp
+36
-16
No files found.
modules/dnn/src/op_inf_engine.cpp
View file @
c2519151
...
...
@@ -409,6 +409,14 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::ICNNNetwork& net)
enginePtr
=
dispatcher
.
getSuitablePlugin
(
targetDevice
);
sharedPlugins
[
targetDevice
]
=
enginePtr
;
std
::
vector
<
std
::
string
>
candidates
;
std
::
string
param_pluginPath
=
utils
::
getConfigurationParameterString
(
"OPENCV_DNN_IE_EXTRA_PLUGIN_PATH"
,
""
);
if
(
!
param_pluginPath
.
empty
())
{
candidates
.
push_back
(
param_pluginPath
);
}
if
(
targetDevice
==
InferenceEngine
::
TargetDevice
::
eCPU
||
targetDevice
==
InferenceEngine
::
TargetDevice
::
eFPGA
)
{
...
...
@@ -422,24 +430,36 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::ICNNNetwork& net)
{
if
(
!
haveFeature
[
i
])
continue
;
#ifdef _WIN32
std
::
string
libName
=
"cpu_extension"
+
suffixes
[
i
]
+
".dll"
;
#elif defined(__APPLE__)
std
::
string
libName
=
"libcpu_extension"
+
suffixes
[
i
]
+
".dylib"
;
#else
std
::
string
libName
=
"libcpu_extension"
+
suffixes
[
i
]
+
".so"
;
#endif // _WIN32
try
{
InferenceEngine
::
IExtensionPtr
extension
=
InferenceEngine
::
make_so_pointer
<
InferenceEngine
::
IExtension
>
(
libName
);
enginePtr
->
AddExtension
(
extension
,
0
);
break
;
}
catch
(...)
{}
#ifdef _WIN32
candidates
.
push_back
(
"cpu_extension"
+
suffixes
[
i
]
+
".dll"
);
#elif defined(__APPLE__)
candidates
.
push_back
(
"libcpu_extension"
+
suffixes
[
i
]
+
".so"
);
// built as loadable module
candidates
.
push_back
(
"libcpu_extension"
+
suffixes
[
i
]
+
".dylib"
);
// built as shared library
#else
candidates
.
push_back
(
"libcpu_extension"
+
suffixes
[
i
]
+
".so"
);
#endif // _WIN32
}
// Some of networks can work without a library of extra layers.
}
bool
found
=
false
;
for
(
size_t
i
=
0
;
i
!=
candidates
.
size
();
++
i
)
{
const
std
::
string
&
libName
=
candidates
[
i
];
try
{
InferenceEngine
::
IExtensionPtr
extension
=
InferenceEngine
::
make_so_pointer
<
InferenceEngine
::
IExtension
>
(
libName
);
enginePtr
->
AddExtension
(
extension
,
0
);
CV_LOG_INFO
(
NULL
,
"DNN-IE: Loaded extension plugin: "
<<
libName
);
found
=
true
;
break
;
}
catch
(...)
{}
}
if
(
!
found
&&
!
candidates
.
empty
())
{
CV_LOG_WARNING
(
NULL
,
"DNN-IE: Can't load extension plugin (extra layers for some networks). Specify path via OPENCV_DNN_IE_EXTRA_PLUGIN_PATH parameter"
);
}
// Some of networks can work without a library of extra layers.
}
plugin
=
InferenceEngine
::
InferencePlugin
(
enginePtr
);
...
...
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