Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created October 29, 2020 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/9b0568736e5b8dcb95fb1fc87a7f3a14 to your computer and use it in GitHub Desktop.
Save amankharwal/9b0568736e5b8dcb95fb1fc87a7f3a14 to your computer and use it in GitHub Desktop.
ageProto = "age_deploy.prototxt"
ageModel = "age_net.caffemodel"
ageNet = cv.dnn.readNet(ageModel, ageProto)
ageList = ['(0 - 2)', '(4 - 6)', '(8 - 12)', '(15 - 20)', '(25 - 32)', '(38 - 43)', '(48 - 53)', '(60 - 100)']
ageNet.setInput(blob)
agePreds = ageNet.forward()
age = ageList[agePreds[0].argmax()]
print("Gender Output : {}".format(agePreds))
print("Gender : {}".format(age))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment