- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm trying to run Age Gender (age-gender-recognition-retail-0013) model in python, and I seem to get only gender results. In out variable, I see only 2 numbers which is the prob. of the person being a male. The document suggests both age / gender as output. Any catch in running it on python?
genet = cv2.dnn.readNet('models/age-gender-recognition-retail-0013.xml', 'models/age-gender-recognition-retail-0013.bin') genet.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD) def detect_gender(frame): blob = cv2.dnn.blobFromImage(frame, size=(62, 62), ddepth=cv2.CV_8U) genet.setInput(blob) out = genet.forward() print(out) return out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the solution meanwhile:
GENDERS_LABELS = ['Female', 'Male'] ... blob = cv2.dnn.blobFromImage(face, size=(62, 62), ddepth=cv2.CV_8U) net.setInput(blob) detections = net.forwardAndRetrieve(['prob', 'age_conv3']) gender = GENDERS_LABELS[detections[0][0][0].argmax()] age = detections[1][0][0][0][0][0] * 100
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jin. It's hard to say what is causing omission of age results. Kindly study the following two C++ samples. Between the two of them you should be able to figure out what's missing in your approach.
\deployment_tools\inference_engine\samples\interactive_face_detection_demo
\deployment_tools\inference_engine\samples\multichannel_face_detection
Sincerely,
Shubha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@trump, jenny - It is not the same thing, 2 different networks are used, one for age, one for gender detection.
I am facing the same issue as Kim. Any help here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the solution meanwhile:
GENDERS_LABELS = ['Female', 'Male'] ... blob = cv2.dnn.blobFromImage(face, size=(62, 62), ddepth=cv2.CV_8U) net.setInput(blob) detections = net.forwardAndRetrieve(['prob', 'age_conv3']) gender = GENDERS_LABELS[detections[0][0][0].argmax()] age = detections[1][0][0][0][0][0] * 100
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page