This commit is contained in:
Şefik Serangil 2020-02-10 16:57:48 +03:00
commit 58aae84e54

View File

@ -2,11 +2,7 @@
[![Downloads](https://pepy.tech/badge/deepface)](https://pepy.tech/project/deepface)
**deepface** is a lightweight python based facial analysis framework including face recognition and demography. You can use the framework with a just few lines of codes.
# Face Recognition
Verify function under the DeepFace interface is used for face recognition.
**deepface** is a lightweight python based face recognition framework. You can verify faces with just a few lines of codes.
```python
from deepface import DeepFace
@ -61,51 +57,6 @@ else:
return False
```
# Facial Attribute Analysis
Deepface also offers facial attribute analysis including [`age`](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [`gender`](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [`emotion`](https://sefiks.com/2018/01/01/facial-expression-recognition-with-keras/) and [`race`](https://sefiks.com/2019/11/11/race-and-ethnicity-prediction-in-keras/) predictions. Analysis function under the DeepFace interface is used to find demography of a face.
```python
from deepface import DeepFace
demography = DeepFace.analyze("img.zip") #passing nothing as 2nd argument will find everything
#demography = DeepFace.analyze("img.zip", ['age', 'gender', 'race', 'emotion']) #identical to above line
```
Analysis function returns a json object.
```
{
"age": 31.940666721338523
, "gender": "Woman"
, "race": {
"asian": 11.314528435468674,
"indian": 17.498773336410522,
"black": 3.541698679327965,
"white": 21.96589708328247,
"middle eastern": 19.87851709127426,
"latino hispanic": 25.800585746765137
}
, "dominant_race": "latino hispanic"
, "emotion": {
"angry": 6.004959843039945e-16,
"disgust": 4.9082449499136944e-34,
"fear": 4.7907148065142067e-23,
"happy": 100.0,
"sad": 4.8685008000541987e-14,
"surprise": 5.66862615875019e-10,
"neutral": 3.754812086254056e-09
}
, "dominant_emotion": "happy"
}
```
Then, you can retrieve the fields of the response object easily in Python.
```python
import json
print("Age: ",demography["age"])
```
# Installation
The easiest way to install deepface is to download it from [PyPI](https://pypi.org/project/deepface/).
@ -126,13 +77,11 @@ Initial tests are run for Python 3.5.5 on Windows 10 but this is an OS-independe
```
pip install numpy==1.14.0
pip install pandas==0.23.4
pip install matplotlib==2.2.2
pip install gdown==3.10.1
pip install opencv-python==3.4.4
pip install tensorflow==1.9.0
pip install keras==2.2.0
pip install tqdm==4.30.0
```
# Disclaimer