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.
6480 Discussions

age-gender-recognition-retail-0013 through cv::dnn API [SOLVED]

Bigorgne__Erwan
Beginner
2,669 Views

Hello,

The embedded opencv release in openvino 2019 R2 provides a very convenient way to handle the pre-trained net. thanks a lot for that.

But for some reason, I can't get any consistent result with the age-gender-recognition-retail-0013 net (FP32 CPU, the same behavior is observed with FP16/MYRIAD)

                  theNet.setInput(blob,"data");
                  std::vector<cv::Mat> netoutputs;
                  std::vector<cv::String> layers{"age_conv3"};
                  theNet.forward(netoutputs,layers);
                  float age =netoutputs[0].at<float>(0)*100.;

where blob = cv::dnn::blobFromImage(...)

I can't figure out why. The age value takes  random values through the runs.

 

 

 

 

 

0 Kudos
1 Solution
Dmitry_K_Intel3
Employee
2,669 Views

Hi!

 

Can reproduce it with a single output. However works fine if you get both age and gender.

image source: https://github.com/opencv/opencv_extra/blob/master/testdata/gpu/lbpcascade/er.png

View solution in original post

0 Kudos
6 Replies
Shubha_R_Intel
Employee
2,669 Views

Dear Bigorgne, Erwan, please study the code of the following demo.  This Demo shows Face Detection coupled with Age/Gender, Head-Pose, Emotion, and Facial Landmarks detectors. Supports video and camera inputs.

Interactive Face Detection C++ Demo

Hope it helps,

Thanks,

Shubha

0 Kudos
Bigorgne__Erwan
Beginner
2,669 Views

Hi Shubha, thank you for the reply,

I eventually evaluated the age-gender net using the InferenceEngine API. It works. However, I would have liked to stick to opencv dnn API, as most of our functionnal blocks are based on this latter one.

Despite it seems to be an opencv-related problem, as openvino embeds a release of opencv libraries compiled by your team, I thought it was better to mention this problem here, in an Intel's forum.

All the openvino-zoo models but the age-gender one work great through the cv::dnn API...

Thanks again

Erwan

 

 

 

   

 

         

 

0 Kudos
Shubha_R_Intel
Employee
2,669 Views

Dear Bigorgne, Erwan,

This forum is dedicated to Model Optimizer and Inference Engine. If you are building your Deep Layer application using OpenCV, you will get better response in the OpenCV forum:

https://github.com/opencv/opencv/issues/

Thanks,

Shubha

0 Kudos
Kurtaev__Dmitry
2,669 Views

Hi!

 

Can reproduce it with a single output. However works fine if you get both age and gender:

 

image source: https://github.com/opencv/opencv_extra/blob/master/testdata/gpu/lbpcascade/er.png

0 Kudos
Dmitry_K_Intel3
Employee
2,670 Views

Hi!

 

Can reproduce it with a single output. However works fine if you get both age and gender.

image source: https://github.com/opencv/opencv_extra/blob/master/testdata/gpu/lbpcascade/er.png

0 Kudos
Bigorgne__Erwan
Beginner
2,669 Views

Hi Dmitry,

You are right!! I may dig deeper to know why.

"If you can't get one one correct output, don't bother to get both of them" doesn't apply here...

Thank you very much.

Erwan. 

 

0 Kudos
Reply