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

age-gender-recognition-retail-0013 gender accuracy

vojko-solvesall
Beginner
950 Views

Hi.

 

I have a problem with gender detection with age-gender-recognition-retail-0013 model.

I used already compiled model from model zoo and while face detection and age detection work quite well in my case, more or less all subjects are detected as males with quite high probability. Even females have probability around 0.9, while males (true positives) are above 0.95.

 

I'm using python.

Model initialization code snipet:

ie = Core()
model = ie.read_model("../gateway_server/models/age-gender-recognition-retail-0013.xml")
compiled_model = ie.compile_model(model=model, device_name="CPU")
input_keys = compiled_model.input(0)
gender_model_output = compiled_model.output(0)
age_model_output = compiled_model.output(1)

Converting detected face:

blob = cv2.dnn.blobFromImage(face_patch, 1.0, (62, 62), model_mean, swapRB=False)

 Estimating gender:

gender_preds = compiled_model([blob])[gender_model_output]
gender = gender_preds[0].argmax()
print("Gender: ", gender, "|", genders[gender], "|", gender_preds)

 

Did I missed something and did something wrong? Or how can I bust accuracy in my case? I did receive a warning:

"Network compiled for 4 shaves, maximum available 16, compiling for 8 shaves likely will yield in better performance"

Would higher shaves really help in my case? That would also mean I have to recompile the model, right?

 

Best regards,

Vojko

0 Kudos
2 Replies
Iffa_Intel
Moderator
883 Views

Hi,

 

the best is to use the OpenVINO official demo as a reference to your custom code since these are validated by OpenVINO and not likely to have issues:

These 2 demos are recommended as written in OpenVINO official documentation of age-gender-recognition-retail-0013 pretrained model

 

 

For accuracy, there are a few factors that could influence:

  1. Model precision (lower model precision is expected to have less accuracy since the size is reduced)
  2. The requirement to feed in more than one model for inferencing (depends on the use case). You may refer to the 2 demos I mentioned above.
  3. Quantize model with accuracy control

 

Cordially,

Iffa

 

0 Kudos
Iffa_Intel
Moderator
837 Views

HI,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question. 


Cordially,

Iffa


0 Kudos
Reply