This repository is used for face classification.
Project description
Face classifier
This repository is used for face classification. It can detect:
- open-closed eyes
- sunglasses
- profile/frontal
- blurry image.
You can find the repository on github.
If you want to use the library directly, go to pypi.
Use Examples
Closed eyes:
from face_classify import classifier
classifier(name='face1', path='face_classify/data/open_test/closed5.jpg')
{'name': 'face1',
'blurry': 0.0,
'profile': 0.0,
'sunglasses': 0.002,
'eyes': (0.009, 0.011)}
Open eyes:
classifier(name='face2', path='face_classify/data/open_test/open2.jpg')
{'name': 'face2',
'blurry': 0.0,
'profile': 0.0,
'sunglasses': 0.0,
'eyes': (0.763, 0.782)}
Profile image
classifier(name='face3', path='face_classify/data/profile_test/profile2.jpg')
{'name': 'face3',
'blurry': 0.0,
'profile': 1.0,
'sunglasses': None,
'eyes': None}
Sunglasses image
classifier(name='face4', path='face_classify/data/sunglasses_test/sunglass1.jpg')
{'name': 'face4',
'blurry': 0.0,
'profile': 0.093,
'sunglasses': 0.93,
'eyes': None}
Blurry image
classifier(name='face5', path='face_classify/data/blurry_test/blurry12.jpg')
{'name': 'face5',
'blurry': 0.998,
'profile': None,
'sunglasses': None,
'eyes': None}
Requirements
- matplotlib==3.3.4
- numpy==1.19.5
- tensorflow==2.9.1
Models
These models have been trained separately using the code from this other repository that I created for 'weddings' pictures classification. Specially bad pictures with closed eyes.
I used a pretrained model MobilenetV2. And then retrained using my own dataset.
The models have been trained with around 10k pictures each.
I cannot upload the datasets as they are mostly from weddings of a friend photographer.
How it works
The program will check conditions and then continue or not depending on the result:
- Blurry picture
- Profile/Frontal
- Sunglasses
- Open-Closed eyes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for face_classify-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dd5f504ba6353dd772db3cd9f855971511d714c248c6884c7cf555f72d545f1 |
|
MD5 | 7ed23b4b96d69fddaaeaa5396adac3e6 |
|
BLAKE2b-256 | 5ca2b1da9fca62614402b94284c3bd40c844bc79e77451f602ff8e5de9febf94 |