Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to predict just gender #119

Open
FranciscoSola opened this issue Feb 4, 2020 · 2 comments
Open

How to predict just gender #119

FranciscoSola opened this issue Feb 4, 2020 · 2 comments

Comments

@FranciscoSola
Copy link

Hi, thanks for the model and the tutorial. I'd like to use it just to predict gender.
Of course I could use the model to predict both and then use only the one i care about but i would like not to lose processing time in something i don't need. Is there a way to sort it out?
Thanks in advance!

@yu4u
Copy link
Owner

yu4u commented Feb 4, 2020

Actually, no. Current model simultaneously estimates age and gender. Thus, there is little computational overhead that can be reduced.

@frankthinker
Copy link

The program now already supports recognizing only gender.

You can try like this:

from deepface import DeepFace

objs = DeepFace.analyze(img_path = "path/to/your/image.jpg", # use the directory of the image you want to recognize
actions = ['gender'] # only gender detection
)
print(objs[0]["dominant_gender"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants