Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Why interactive_face_detection_demo uses two plugins instead of just one?

Gouveia__César
New Contributor I
476 Views

Hi,

I'm using your interactive_face_detection_demo which can be found on the samples folder on the OpenVINO toolkit: https://docs.openvinotoolkit.org/2019_R2/_demos_interactive_face_detection_demo_README.html. I'm running the sample with a NCS2 and I'm on Windows 10. Inside the script I run your face detector model: https://download.01.org/opencv/2019/open_model_zoo/R1/20190404_140900_models_bin/face-detection-retail-0004/FP16/ and your age gender model: https://download.01.org/opencv/2019/open_model_zoo/R1/20190404_140900_models_bin/facial-landmarks-35-adas-0002/FP16/. Both are on FP16 in order to run on NCS2 Movidius.

That said, I have used this command line to use a sequence of face detection and age gender recognition on NCS2:

-i cam -o C:/OutputDir -m face-detection-retail-0004.xml -m_ag age-gender-recognition-retail-0013.xml -d MYRIAD -d_ag MYRIAD

Before running the script I added a few lines of code to it to understand the type of plugin I was using (my expectation were that I was only using the MYRIAD plugin). However after running the script I find that two plugins are being used: the CPU plugin and the MOVIDIUS plugin. Why are two plugins imported when I clearly defined that I only wanted to use the MYRIAD plugin?

 

Lines of code added to the main code of the interactive_face_detection_demo script:

 

/** Per-layer metrics **/
        if (FLAGS_pc) {
            for (auto && plugin : pluginsForDevices) {
                plugin.second.SetConfig({{PluginConfigParams::KEY_PERF_COUNT, PluginConfigParams::YES}});
            }
        }

        std::cout << "Plugins being used before (Reading IR models and loading them to plugins):" << std::endl;
        for (auto it = pluginsForDevices.begin(); it != pluginsForDevices.end(); ++it) {
            std::cout << it->first.c_str() << std::endl;
        }
        // ---------------------------------------------------------------------------------------------------

        // --------------------------- 2. Reading IR models and loading them to plugins ----------------------
        // Disable dynamic batching for face detector as it processes one image at a time
        Load(faceDetector).into(pluginsForDevices[FLAGS_d], false);
        Load(ageGenderDetector).into(pluginsForDevices[FLAGS_d_ag], false);
        Load(headPoseDetector).into(pluginsForDevices[FLAGS_d_hp], FLAGS_dyn_hp);
        Load(emotionsDetector).into(pluginsForDevices[FLAGS_d_em], FLAGS_dyn_em);
        Load(facialLandmarksDetector).into(pluginsForDevices[FLAGS_d_lm], FLAGS_dyn_lm);

        std::cout << "Plugins being used after (Reading IR models and loading them to plugins):" << std::endl;
        for (auto it = pluginsForDevices.begin(); it != pluginsForDevices.end(); ++it) {
            std::cout << it->first.c_str() << std::endl;
        }
        // ----------------------------------------------------------------------------------------------------

        // --------------------------- 3. Doing inference -----------------------------------------------------
        // Starting inference & calculating performance
        slog::info << "Start inference " << slog::endl;
        if (!FLAGS_no_show) {
            std::cout << "Press any key to stop" << std::endl;
        }

 

Console output after running the script:

InferenceEngine:
        API version ............ 1.6
        Build .................. 23780
[ INFO ] Parsing input parameters
[ INFO ] Reading input
[ INFO ] Loading plugin MYRIAD

        API version ............ 1.6
        Build .................. 23780
        Description ....... myriadPlugin
Plugins being used before (Reading IR models and loading them to plugins):
MYRIAD
[ INFO ] Loading network files for Face Detection
[ INFO ] Batch size is set to 1
[ INFO ] Checking Face Detection network inputs
[ INFO ] Checking Face Detection network outputs
[ INFO ] Loading Face Detection model to the MYRIAD plugin
[ INFO ] Loading network files for Age/Gender Recognition network
[ INFO ] Batch size is set to 16 for Age/Gender Recognition network
[ INFO ] Checking Age/Gender Recognition network inputs
[ INFO ] Checking Age/Gender Recognition network outputs
[ INFO ] Age layer: age_conv3
[ INFO ] Gender layer: prob
[ INFO ] Loading Age/Gender Recognition model to the MYRIAD plugin
E: [ncAPI] [         0] ncDeviceOpen:672   Failed to find suitable device, rc: X_LINK_DEVICE_NOT_FOUND
[ INFO ] Head Pose DISABLED
[ INFO ] Emotions Recognition DISABLED
[ INFO ] Facial Landmarks DISABLED
Plugins being used after (Reading IR models and loading them to plugins):
CPU
MYRIAD
[ INFO ] Start inference
Press any key to stop
To close the application, press 'CTRL+C' or any key with focus on the output window

 

Thanks, César.

0 Kudos
5 Replies
Vladimir_Dudnik
Employee
476 Views

Could you please try the latest release, which is OpenVINO 2020.2 to see if there are any difference?

0 Kudos
David_C_Intel
Employee
476 Views

Hi Cesar,

Thanks for reaching out.

We are currently looking into your issue and will reply to you as soon as possible.

 

Regards,

David

0 Kudos
Gouveia__César
New Contributor I
476 Views

Hi Vladimir,

Could you please try the latest release, which is OpenVINO 2020.2 to see if there are any difference?

I can't, I only want to test for this version specifically.

0 Kudos
Gouveia__César
New Contributor I
476 Views

Hi David,

We are currently looking into your issue and will reply to you as soon as possible.

Thank you very much, looking forward for your answer!

César.

0 Kudos
David_C_Intel
Employee
476 Views

 

Hi Cesar,

Apologies for the delay in our response. We have tested a sample using the Myriad plugin and if the device is not available (unplugged), the program terminates and will not inference on CPU plugin even if present.

Something you can try is to run your program with the Intel® NCS unplugged from the system and see if inference actually occurs. If it does inference with Myriad not present, there is probably some logic in your code that is allowing this to occur (like a fallback to CPU device in case Myriad device is unavailable). We cannot tell that is actually happening by just looking at the snippet of code shared. If it does not inference, then this verifies CPU is not actually being used for inference even though it is present.

Hope this helps, let me know if you have additional questions.

Best regards,

David

0 Kudos
Reply