How to predict just gender
FranciscoSola opened this issue · 2 comments
FranciscoSola commented
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 commented
Actually, no. Current model simultaneously estimates age and gender. Thus, there is little computational overhead that can be reduced.
frankthinker commented
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"])