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.

Age and Gender Detection in Python

Duggy
New Contributor I
1,140 Views

Hi,

Is there a face (Age and Gender) detection demo in python? I see the C++ but struggling to create a python equivalent. 

Much appreciated!

Labels (1)
0 Kudos
1 Solution
Vladimir_Dudnik
Employee
1,092 Views

@Duggy  it depends on what is your goal. It should relatively easy to call age-gender-recognition-retail-0013 or emotions-recognition-retail-0003 models in Python, just notice, they take as input a crop of input image with detected face, so practically, you will need to call some face detection model, then pass crops with detected faces to these models as input, one by one, if image contains many faces. But for test purposes you may prepare such crops by any way (and store as small image files) outside of your test.

 

Then you may try to modify Python face_recognition_demo, which already detects faces on input image, to extend it with call for age-and-gender or/and emotions detectors. You will need extend FrameProcessor class and  draw_detections function in face_recognition.py file with adding infer for new models and drawing results.

View solution in original post

4 Replies
Vladimir_Dudnik
Employee
1,119 Views

@Duggy  we do not have python demo for age and gender or emotions recognition models. But what kind of difficulties do you have in creating python application for these models? Is that not clear how to run inference in python with OpenVINO?

0 Kudos
Duggy
New Contributor I
1,108 Views

Hi,

 

Was hoping to utilize an existing demo to make life easier. Not sure which one would be the easiest to implement rather than starting from scratch.

Thanks.

 

0 Kudos
Vladimir_Dudnik
Employee
1,093 Views

@Duggy  it depends on what is your goal. It should relatively easy to call age-gender-recognition-retail-0013 or emotions-recognition-retail-0003 models in Python, just notice, they take as input a crop of input image with detected face, so practically, you will need to call some face detection model, then pass crops with detected faces to these models as input, one by one, if image contains many faces. But for test purposes you may prepare such crops by any way (and store as small image files) outside of your test.

 

Then you may try to modify Python face_recognition_demo, which already detects faces on input image, to extend it with call for age-and-gender or/and emotions detectors. You will need extend FrameProcessor class and  draw_detections function in face_recognition.py file with adding infer for new models and drawing results.

Wan_Intel
Moderator
1,039 Views

Hi Vladimir_Dudnik,

Thank you for providing your solutions in the community!



Hi Duggy,


This thread will no longer be monitored since this issue has been resolved. 

If you need any additional information from Intel, please submit a new question.



Regards,

Wan


0 Kudos
Reply