Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Duggy
Novice
169 Views

Age and Gender Detection in Python

Jump to solution

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
120 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
148 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?

Duggy
Novice
137 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.

 

Vladimir_Dudnik
Employee
121 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

Wan_Intel
Moderator
68 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


Reply