message: dnn: configure plugin path for InferenceEngine
diff: @@ -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)
  {
  @@ -423,23 +431,35 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::ICNNNetwork& net)
  if (!haveFeature[i])
  continue;
  #ifdef _WIN32
  - std::string libName = "cpu_extension" + suffixes[i] + ".dll";
  + candidates.push_back("cpu_extension" + suffixes[i] + ".dll");
  #elif defined(__APPLE__)
  - std::string libName = "libcpu_extension" + suffixes[i] + ".dylib";
  + 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
  - std::string libName = "libcpu_extension" + suffixes[i] + ".so";
  + candidates.push_back("libcpu_extension" + suffixes[i] + ".so");
  #endif // _WIN32
  + }
  + }
  + 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(...) {}
  }
  - // Some of networks can work without a library of extra layers.
  + 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);
  