Face Detection, landmark detection and gender classification in a unified workflow
- keras
- dlib
- imutils
- cv2
- numpy
- sklearn
- scipy
- pandas
- pickle
- Unzip pre-trained weights into model/ from here
- cd into src/ directory
python deploy.py
with the default settingspython deploy.py --model 'DL'
with Deep-learning based model for gender classificationpython deploy.py --model 'DL' --image 'Path to image'
, sample images are present in '../data/'python deploy_video.py
for video-camera based version with PCA trained Gender classifier
- Face landmarking is done using dlib
- Gender Classifier based on Deep Learning, and PCA are both trained on LFW deep funelled dataset
- Images in ../data/ with prefix '0_{}.jpg' are from LFW and '1_{}.jpg' from COCO dataset
- Deep Learning based method is two times(2x) slower than simpler model just using PCA, but Deep Learning based method for gender classification is more accurate. See performance of both the models on ../data/0_2.jpg for the image from same distribution(LFW), and ../data/1_1.jpg for image from a different distribution(COCO)
- The model works well with multiple images in a frame, see ../data/0_6.jpg
Adrian Rosebrock for imutils