dlib-models icon indicating copy to clipboard operation
dlib-models copied to clipboard

How to use dnn_gender_classifier_v1.dat in Python?

Open mowshon opened this issue 4 years ago • 4 comments

Hello, @davisking !

How to load the dnn_gender_classifier_v1.dat in Python ? I can't find alternative for C++ deserialize in Python.

mowshon avatar Jun 11 '20 15:06 mowshon

@davisking can you take a look at https://github.com/mowshon/age-and-gender

I don't have good skill in C++, but did my best for running this code on python.

mowshon avatar Jun 17 '20 19:06 mowshon

Nice, I've seen that you open images directly from the path. You can get some inspiration from this example to make it work with PIL images or numpy arrays directly.

https://github.com/arrufat/wallyfinder

EDIT: In particular, these two functions https://github.com/arrufat/wallyfinder/blob/2a3ddc1af2b676ad434574fecd9be0004c0fcc23/src/wallyfinder.cpp#L8-L42

arrufat avatar Jun 17 '20 23:06 arrufat

@arrufat wow! I realy need this! Thank you!

mowshon avatar Jun 18 '20 08:06 mowshon

@mowshon I'm really glad to see that the models I've released can find a usage... I am working on improving the model for enhancing gender detection for certain ethnic groups that are apparently under-represented in the original database.

Cydral avatar Feb 14 '21 09:02 Cydral