1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Different way to reset Myriad device

This commit is contained in:
Dmitry Kurtaev
2020-01-15 16:22:00 +03:00
committed by Alexander Alekhin
parent 8cb0a37336
commit cb64fdabb5
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ public:
#ifdef HAVE_INF_ENGINE
static inline bool checkIETarget(Target target)
{
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2019R3)
#if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2019R3)
// Lightweight detection
const std::vector<std::string> devices = getCore().GetAvailableDevices();
for (std::vector<std::string>::const_iterator i = devices.begin(); i != devices.end(); ++i)
+9 -3
View File
@@ -574,7 +574,7 @@ InferenceEngine::Core& getCore()
#if !defined(OPENCV_DNN_IE_VPU_TYPE_DEFAULT)
static bool detectMyriadX_()
{
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2019R3)
#if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2019R3)
// Lightweight detection
InferenceEngine::Core& ie = getCore();
const std::vector<std::string> devices = ie.GetAvailableDevices();
@@ -1075,8 +1075,14 @@ void resetMyriadDevice()
#if INF_ENGINE_VER_MAJOR_LE(INF_ENGINE_RELEASE_2019R1)
getSharedPlugins().erase("MYRIAD");
#else
// To unregister both "MYRIAD" and "HETERO:MYRIAD,CPU" plugins
getCore() = InferenceEngine::Core();
// Unregister both "MYRIAD" and "HETERO:MYRIAD,CPU" plugins
InferenceEngine::Core& ie = getCore();
try
{
ie.UnregisterPlugin("MYRIAD");
ie.UnregisterPlugin("HETERO");
}
catch (...) {}
#endif
#endif // HAVE_INF_ENGINE
}