Community
cancel
Showing results for 
Search instead for 
Did you mean: 
YWaka2
Beginner
621 Views

I want to do step 2 of "Face detection Tutorial"

Jump to solution

I use the web (https://github.com/intel-iot-devkit/inference-tutorials-generic/blob/openvino_toolkit_2019_r1_0/face...). the codes in the web has many deprecated codes. therefore, I can not execute the command "make".

 

my pc` informatin is below.

OS: Ubuntu 16.04LTS

OpenVINO Toolkit ver: 2019.2.275

 

although I watch the web (https://docs.openvinotoolkit.org/latest/deprecated.html), I have no idea where the codes in step2 changes.

0 Kudos

Accepted Solutions
Luis_at_Intel
Moderator
155 Views

Hi @YWaka2​,

 

I am not sure what the problem could be, for me a similar error occurred when the models were not being found by the setupenv.sh script. Also that function that is throwing the error is deprecated in R2, you may need to do more changes to the sample code to fix other function calls that differ from current API. It may not be a straight forward process.

 

This line in main.cpp:

InferencePlugin plugin = PluginDispatcher({"../../../lib/intel64", ""}).getPluginByDevice(deviceName);

 

Using the deprecated list I tried this:

InferenceEngine::Core core;

And there may be other places in the sample code that need to reflect the changes. For example:

# this printPluginVersion(plugin, std::cout); # becomes this std::cout << core.GetVersions(deviceName) << std::endl;

 

 

Regards,

@Luis_at_Intel​ 

View solution in original post

12 Replies
Lakshmi_U_Intel
Employee
155 Views

Hi,

 

Thanks for reaching out to us.

 

As per the github repo,(https://github.com/intel-iot-devkit/inference-tutorials generic/tree/openvino_toolkit_2019_r1_0/face_detection_tutorial) , they already mentioned that this tutorial has been written using Intel® Distribution of OpenVINO™ toolkit version 2019 R1.0 and is for use with this version only and using this tutorial with any other version may not be correct. This may be the reason for the error that you are getting while executing the "make" command.

 

Since this is an OpenVINO related question, we are moving this case to a more appropriate queue for a faster response.

 

Thanks.

Luis_at_Intel
Moderator
155 Views

Hi @YWaka2​ ,

 

Thanks for contacting us. Just as @LakshmiU_Intel​  mentioned and as you probably already know, this particular tutorial has been written for R1. I am not aware if there will be an update to those examples for R2 there, but may be worth to keep an eye for that.

 

There are a couple of things I could suggest:

  1. Take a look at the code in Step 2 of the example you have, glance at the functions/classes used and then compare to the deprecated list. If its deprecated then use the replacing class/function referenced.
  2. You can also take a look at the face detection sample provided in R2 documentation for C++ here.
  3. Another alternative is to "downgrade" to R1 so that the example you are looking at runs fine.

 

I hope you have found this information helpful, please let us know if you have any additional questions.

 

 

Regards,

@Luis_at_Intel​ 

 

YWaka2
Beginner
155 Views

Thank you for your reply.

 

I have already changed codes from R1 codes to R2 codes in view of the deprecated list. Therefore I could execute the command "make".

but I have errors when I execute the following command.

./intel64/Release/face_detection_tutorial -m $mFDA32 -i ../../data/face.jpg

Errors are below. I have no idea why the following errors reads out.

InferenceEngine: API version ............ 2.0 Build .................. custom_releases/2019/R2_f5827d4773ebbe727c9acac5f007f7d94dd4be4e Description ....... API [ INFO ] Parsing input parameters [ INFO ] Reading input [ INFO ] Loading plugin CPU [ ERROR ] Error loading xmlfile: ../../../lib/intel64, File was not found at line: 1 pos: 0

 

 

Luis_at_Intel
Moderator
155 Views

Hi @YWaka2​ ,

 

Taking a a closer look at the setenv.sh script found under ~/inference-tutorials-generic/face_detection_tutorial/tutorials/inference-tutorials-generic/face_detection_tutorial/scripts, it looks like is having issues setting up the model name due to way Model Downloader in R2 2019 saves downloaded models (filenames and model paths). That is the reason why when you execute the program it fails to find the .xml file of the model, throwing the error. Please modify export lines of the setenv.sh file to look like the lines below and source it once updated:

export mFDA16=`find $modelDir -print0 | grep -FzZ "FP16/${modName}.xml"` export mFDA32=`find $modelDir -print0 | grep -FzZ "FP32/${modName}.xml"`

 

Regards,

@Luis_at_Intel​ 

 

YWaka2
Beginner
155 Views

Thank you for your reply.

 

Is setenv.sh setupenv.sh under the dir "tutorials/inference-tutorials-generic/face_detection_tutorial/scripts" ?

I modified the codes of setupenv.sh.

the codes are below.

# use relative location of script to specify where to find downloaded models scriptDir=`cd $(dirname $BASH_SOURCE); pwd` modelDir=`cd $scriptDir/../../../tutorial_models/face_detection; pwd`   # Face Detection Model - ADAS modName=face-detection-adas-0001 #export mFDA16=`find $modelDir -name "${modName}-fp16.xml"` #export mFDA32=`find $modelDir -name "${modName}.xml"` export mFDA16=`find $modeDir -print0 | grep -FzZ "FP16/${modName}.xml"` export mFDA32=`find $modeDir -print0 | grep -FzZ "FP32/${modName}.xml"`   # Face Detection Model - Retail modName=face-detection-retail-0004 #export mFDR16=`find $modelDir -name "${modName}-fp16.xml"` #export mFDR32=`find $modelDir -name "${modName}.xml"` export mFDA16=`find $modeDir -print0 | grep -FzZ "FP16/${modName}.xml"` export mFDA32=`find $modeDir -print0 | grep -FzZ "FP32/${modName}.xml"`   # Age and Gender Model modName=age-gender-recognition-retail-0013 #export mAG16=`find $modelDir -name "${modName}-fp16.xml"` #export mAG32=`find $modelDir -name "${modName}.xml"` export mFDA16=`find $modeDir -print0 | grep -FzZ "FP16/${modName}.xml"` export mFDA32=`find $modeDir -print0 | grep -FzZ "FP32/${modName}.xml"`   # Head Pose Estimation Model modName=head-pose-estimation-adas-0001 #export mHP16=`find $modelDir -name "${modName}-fp16.xml"` #export mHP32=`find $modelDir -name "${modName}.xml"` export mFDA16=`find $modeDir -print0 | grep -FzZ "FP16/${modName}.xml"` export mFDA32=`find $modeDir -print0 | grep -FzZ "FP32/${modName}.xml"`

But I still have same errors.

InferenceEngine: API version ............ 2.0 Build .................. custom_releases/2019/R2_f5827d4773ebbe727c9acac5f007f7d94dd4be4e Description ....... API [ INFO ] Parsing input parameters [ INFO ] Reading input [ INFO ] Loading plugin CPU [ ERROR ] Error loading xmlfile: ../../../lib/intel64, File was not found at line: 1 pos: 0

 

Luis_at_Intel
Moderator
155 Views

Hi @YWaka2​ ,

 

I apologize for the error, and yes I meant the setupenv.sh script. That is very interesting, I saw the same error and was because the script was not setting up the variables correctly (because it didn't find the path to the models so the variables were empty).

 

Could you please run this command and let me know what the output is? The path may differ to yours but should look similar

ls -lR ~/inference-tutorials-generic/face_detection_tutorial/tutorials/tutorial_models/face_detection/ | grep ".*.xml"

The output of that should look something similar to this:

-rw-rw-r-- 1 user user 14811 Sep 18 08:51 age-gender-recognition-retail-0013.xml -rw-rw-r-- 1 user user 14821 Sep 18 08:51 age-gender-recognition-retail-0013.xml -rw-rw-r-- 1 user user 47998 Sep 18 08:51 face-detection-retail-0004.xml -rw-rw-r-- 1 user user 48040 Sep 18 08:51 face-detection-retail-0004.xml -rw-rw-r-- 1 user user 738371 Sep 18 08:51 face-detection-retail-0004.xml -rw-rw-r-- 1 user user 18215 Sep 18 08:51 head-pose-estimation-adas-0001.xml -rw-rw-r-- 1 user user 18226 Sep 18 08:51 head-pose-estimation-adas-0001.xml -rw-rw-r-- 1 user user 91216 Sep 18 08:51 head-pose-estimation-adas-0001.xml -rw-rw-r-- 1 user user 89541 Sep 18 08:51 face-detection-adas-0001.xml -rw-rw-r-- 1 user user 89578 Sep 18 08:51 face-detection-adas-0001.xml -rw-rw-r-- 1 user user 3357738 Sep 18 08:51 face-detection-adas-0001.xml

If that is not the case then you may be missing out on downloading the models as stated in the tutorial using the get_models.sh script.

 

 

Regards,

@Luis_at_Intel​ 

YWaka2
Beginner
155 Views

Thank you for your reply.

I download the model.

The output is below

[get_models.sh]:: Models have been downloaded to: /home/xlpt/tutorials/tutorial_models/face_detection [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/INT8/face-detection-retail-0004.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP32/face-detection-retail-0004.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP16/face-detection-retail-0004.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Retail/object_attributes/age_gender/dldt/FP32/age-gender-recognition-retail-0013.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Retail/object_attributes/age_gender/dldt/FP16/age-gender-recognition-retail-0013.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_detection/face/pruned_mobilenet_reduced_ssd_shared_weights/dldt/INT8/face-detection-adas-0001.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_detection/face/pruned_mobilenet_reduced_ssd_shared_weights/dldt/FP32/face-detection-adas-0001.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_detection/face/pruned_mobilenet_reduced_ssd_shared_weights/dldt/FP16/face-detection-adas-0001.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_attributes/headpose/vanilla_cnn/dldt/INT8/head-pose-estimation-adas-0001.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_attributes/headpose/vanilla_cnn/dldt/FP32/head-pose-estimation-adas-0001.xml [get_models.sh]:Downloaded model: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_attributes/headpose/vanilla_cnn/dldt/FP16/head-pose-estimation-adas-0001.xml

I executed the following command.

ls -lR ~/tutorials/inference-tutorials-generic/face_detection_tutorial/ | grep ".*.xml"

But I did not have the output.

YWaka2
Beginner
155 Views

I executed the following command in each dir.

ls -lR

I have the following output.

-rw-rw-r-- 1 xlpt xlpt 738371 Sep 18 16:53 face-detection-retail-0004.xml -rw-rw-r-- 1 xlpt xlpt 48040 Sep 18 16:53 face-detection-retail-0004.xml -rw-rw-r-- 1 xlpt xlpt 47998 Sep 18 16:53 face-detection-retail-0004.xml -rw-rw-r-- 1 xlpt xlpt 14821 Sep 18 16:53 age-gender-recognition-retail-0013.xml -rw-rw-r-- 1 xlpt xlpt 14811 Sep 18 16:53 age-gender-recognition-retail-0013.xml -rw-rw-r-- 1 xlpt xlpt 3357738 Sep 18 16:53 face-detection-adas-0001.xml -rw-rw-r-- 1 xlpt xlpt 89578 Sep 18 16:53 face-detection-adas-0001.xml -rw-rw-r-- 1 xlpt xlpt 89541 Sep 18 16:53 face-detection-adas-0001.xml -rw-rw-r-- 1 xlpt xlpt 91216 Sep 18 16:53 head-pose-estimation-adas-0001.xml -rw-rw-r-- 1 xlpt xlpt 18226 Sep 18 16:53 head-pose-estimation-adas-0001.xml -rw-rw-r-- 1 xlpt xlpt 18215 Sep 18 16:53 head-pose-estimation-adas-0001.xml

 

 

Luis_at_Intel
Moderator
155 Views

Great! Now it looks like the models are downloaded and found in your machine. Have you set the environment with the source command?

 

source ~/tutorials/inference-tutorials-generic/face_detection_tutorial/scripts/setupenv.sh

You can test to see if the variables are being created correctly by printing it. If the variable is empty (no output returned when printing it), then you may need to modify the setupenv.sh file to point to the directory where you have stored the downloaded models.

$mFDA32 # Terminal output similar to this: bash: /home/user/tutorials/tutorial_models/face_detection/Transportation/object_detection/face/pruned_mobilenet_reduced_ssd_shared_weights/dldt/FP32/face-detection-adas-0001.xml: Permission denied

 

Regards,

@Luis_at_Intel​ 

YWaka2
Beginner
155 Views

thank you for your reply.

 

I modified the setupenv.sh as below.

modName=face-detection-adas-0001 export mFDA32=`/home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_detection/face/pruned_mobilenet_reduced_ssd_shared_weights/dldt/FP32/face-detection-adas-0001.xml`

Then I have the output as below. Please let me know how I should modify the setupenv.sh.

source ~/tutorials/inference-tutorials-generic/face_detection_tutorial/scripts/setupenv.sh bash: /home/xlpt/tutorials/tutorial_models/face_detection/Transportation/object_detection/face/pruned_mobilenet_reduced_ssd_shared_weights/dldt/FP32/face-detection-adas-0001.xml: Permission denied

By the way, the main.cpp (under ~/tutorials/inference-tutorials-generic/face_detection_tutorial/step_2) has the following codes.

InferenceEngine::Core plugin = InferenceEngine::Core("../../../lib/intel64");

Because of the above codes, did I get the following errors ?

InferenceEngine: API version ............ 2.0 Build .................. custom_releases/2019/R2_f5827d4773ebbe727c9acac5f007f7d94dd4be4e Description ....... API [ INFO ] Parsing input parameters [ INFO ] Reading input [ INFO ] Loading plugin CPU [ ERROR ] Error loading xmlfile: ../../../lib/intel64, File was not found at line: 1 pos: 0

thanks,

Luis_at_Intel
Moderator
156 Views

Hi @YWaka2​,

 

I am not sure what the problem could be, for me a similar error occurred when the models were not being found by the setupenv.sh script. Also that function that is throwing the error is deprecated in R2, you may need to do more changes to the sample code to fix other function calls that differ from current API. It may not be a straight forward process.

 

This line in main.cpp:

InferencePlugin plugin = PluginDispatcher({"../../../lib/intel64", ""}).getPluginByDevice(deviceName);

 

Using the deprecated list I tried this:

InferenceEngine::Core core;

And there may be other places in the sample code that need to reflect the changes. For example:

# this printPluginVersion(plugin, std::cout); # becomes this std::cout << core.GetVersions(deviceName) << std::endl;

 

 

Regards,

@Luis_at_Intel​ 

View solution in original post

Luis_at_Intel
Moderator
155 Views

Hi @YWaka2​ 

I am not sure what the problem could be, for me a similar error occurred when the models were not being found by the setupenv.sh script. Also that function that is throwing the error is deprecated in R2, you may need to do more changes to the sample code to fix other function calls that differ from current API. It may not be a straight forward process.

 

This line in main.cpp:

InferencePlugin plugin = PluginDispatcher({"../../../lib/intel64", ""}).getPluginByDevice(deviceName);

Using the deprecated list I tried this:

InferenceEngine::Core core;

 

And there may be other places in the sample code that need to reflect the changes. For example:

# this printPluginVersion(plugin, std::cout); # becomes this std::cout << core.GetVersions(deviceName) << std::endl;

 

Regards,

@Luis_at_Intel​