# deepface
<div align="center">
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/deepface?period=total&units=international_system&left_color=grey&right_color=blue&left_text=pypi%20downloads)](https://pepy.tech/project/deepface)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/deepface?color=green&label=conda%20downloads)](https://anaconda.org/conda-forge/deepface)
[![Stars](https://img.shields.io/github/stars/serengil/deepface?color=yellow&style=flat)](https://github.com/serengil/deepface/stargazers)
[![License](http://img.shields.io/:license-MIT-green.svg?style=flat)](https://github.com/serengil/deepface/blob/master/LICENSE)
[![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dserengil%26type%3Dpatrons&style=flat)](https://www.patreon.com/serengil?repo=deepface)
[![Twitter](https://img.shields.io/twitter/follow/serengil?color=blue&logo=twitter&style=flat)](https://twitter.com/serengil)
[![DOI](http://img.shields.io/:DOI-10.1109/ASYU50717.2020.9259802-blue.svg?style=flat)](https://doi.org/10.1109/ASYU50717.2020.9259802)
[![DOI](http://img.shields.io/:DOI-10.1109/ICEET53442.2021.9659697-blue.svg?style=flat)](https://doi.org/10.1109/ICEET53442.2021.9659697)
</div>
<p align="center"><img src="https://raw.githubusercontent.com/serengil/deepface/master/icon/deepface-icon-labeled.png" width="200" height="240"></p>
Deepface is a lightweight [face recognition](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and facial attribute analysis ([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/)) framework for python. It is a hybrid face recognition framework wrapping **state-of-the-art** models: [`VGG-Face`](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/), [`Google FaceNet`](https://sefiks.com/2018/09/03/face-recognition-with-facenet-in-keras/), [`OpenFace`](https://sefiks.com/2019/07/21/face-recognition-with-openface-in-keras/), [`Facebook DeepFace`](https://sefiks.com/2020/02/17/face-recognition-with-facebook-deepface-in-keras/), [`DeepID`](https://sefiks.com/2020/06/16/face-recognition-with-deepid-in-keras/), [`ArcFace`](https://sefiks.com/2020/12/14/deep-face-recognition-with-arcface-in-keras-and-python/), [`Dlib`](https://sefiks.com/2020/07/11/face-recognition-with-dlib-in-python/) and `SFace`.
Experiments show that human beings have 97.53% accuracy on facial recognition tasks whereas those models already reached and passed that accuracy level.
## Installation [![PyPI](https://img.shields.io/pypi/v/deepface.svg)](https://pypi.org/project/deepface/) [![Conda](https://img.shields.io/conda/vn/conda-forge/deepface.svg)](https://anaconda.org/conda-forge/deepface)
The easiest way to install deepface is to download it from [`PyPI`](https://pypi.org/project/deepface/). It's going to install the library itself and its prerequisites as well.
```shell
$ pip install deepface
```
DeepFace is also available at [`Conda`](https://anaconda.org/conda-forge/deepface). You can alternatively install the package via conda.
```shell
$ conda install -c conda-forge deepface
```
Then you will be able to import the library and use its functionalities.
```python
from deepface import DeepFace
```
**Facial Recognition** - [`Demo`](https://youtu.be/WnUVYQP4h44)
A modern [**face recognition pipeline**](https://sefiks.com/2020/05/01/a-gentle-introduction-to-face-recognition-in-deep-learning/) consists of 5 common stages: [detect](https://sefiks.com/2020/08/25/deep-face-detection-with-opencv-in-python/), [align](https://sefiks.com/2020/02/23/face-alignment-for-face-recognition-in-python-within-opencv/), [normalize](https://sefiks.com/2020/11/20/facial-landmarks-for-face-recognition-with-dlib/), [represent](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) and [verify](https://sefiks.com/2020/05/22/fine-tuning-the-threshold-in-face-recognition/). While Deepface handles all these common stages in the background, you don’t need to acquire in-depth knowledge about all the processes behind it. You can just call its verification, find or analysis function with a single line of code.
**Face Verification** - [`Demo`](https://youtu.be/KRCvkNCOphE)
This function verifies face pairs as same person or different persons. It expects exact image paths as inputs. Passing numpy or base64 encoded images is also welcome. Then, it is going to return a dictionary and you should check just its verified key.
```python
result = DeepFace.verify(img1_path = "img1.jpg", img2_path = "img2.jpg")
```
<p align="center"><img src="https://raw.githubusercontent.com/serengil/deepface/master/icon/stock-1.jpg" width="95%" height="95%"></p>
**Face recognition** - [`Demo`](https://youtu.be/Hrjp-EStM_s)
[Face recognition](https://sefiks.com/2020/05/25/large-scale-face-recognition-for-deep-learning/) requires applying face verification many times. Herein, deepface has an out-of-the-box find function to handle this action. It's going to look for the identity of input image in the database path and it will return pandas data frame as output.
```python
df = DeepFace.find(img_path = "img1.jpg", db_path = "C:/workspace/my_db")
```
<p align="center"><img src="https://raw.githubusercontent.com/serengil/deepface/master/icon/stock-6-v2.jpg" width="95%" height="95%"></p>
**Embeddings**
Face recognition models basically represent facial images as multi-dimensional vectors. Sometimes, you need those embedding vectors directly. DeepFace comes with a dedicated representation function.
```python
embedding = DeepFace.represent(img_path = "img.jpg")
```
This function returns an array as output. The size of the output array would be different based on the model name. For instance, VGG-Face is the default model for deepface and it represents facial images as 2622 dimensional vectors.
```python
assert isinstance(embedding, list)
assert model_name = "VGG-Face" and len(embedding) == 2622
```
Here, embedding is also [plotted](https://sefiks.com/2020/05/01/a-gentle-introduction-to-face-recognition-in-deep-learning/) with 2622 slots horizontally. Each slot is corresponding to a dimension value in the embedding vector and dimension value is explained in the colorbar on the right. Similar to 2D barcodes, vertical dimension stores no information in the illustration.
<p align="center"><img src="https://raw.githubusercontent.com/serengil/deepface/master/icon/embedding.jpg" width="95%" height="95%"></p>
**Face recognition models** - [`Demo`](https://youtu.be/i_MOwvhbLdI)
Deepface is a **hybrid** face recognition package. It currently wraps many **state-of-the-art** face recognition models: [`VGG-Face`](https://sefiks.com/2018/08/06/deep-face-recognition-with-keras/) , [`Google FaceNet`](https://sefiks.com/2018/09/03/face-recognition-with-facenet-in-keras/), [`OpenFace`](https://sefiks.com/2019/07/21/face-recognition-with-openface-in-keras/), [`Facebook DeepFace`](https://sefiks.com/2020/02/17/face-recognition-with-facebook-deepface-in-keras/), [`DeepID`](https://sefiks.com/2020/06/16/face-recognition-with-deepid-in-keras/), [`ArcFace`](https://sefiks.com/2020/12/14/deep-face-recognition-with-arcface-in-keras-and-python/), [`Dlib`](https://sefiks.com/2020/07/11/face-recognition-with-dlib-in-python/) and `SFace`. The default configuration uses VGG-Face model.
```python
models = [
"VGG-Face",
"Facenet",
"Facenet512",
"OpenFace",
"DeepFace",
"DeepID",
"ArcFace",
"Dlib",
"SFace",
]
#face verification
result = DeepFace.verify(img1_path = "img1.jpg",
img2_path = "img2.jpg",
model_name = models[1]
)
#face recognition
df = DeepFace.find(img_path = "img1.jpg",
d
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
deepface实现人脸识别 (128个子文件)
face-recognition-pivot.csv 40KB
master.csv 7KB
Dockerfile 215B
.gitignore 424B
Fine-Tuning-Threshold.ipynb 34KB
retinaface-results.jpeg 457KB
img26.jpg 2.36MB
img1.jpg 2.18MB
img33.jpg 2.07MB
img35.jpg 1.3MB
img40.jpg 1.13MB
img58.jpg 973KB
img39.jpg 776KB
img54.jpg 685KB
img49.jpg 676KB
img3.jpg 647KB
img23.jpg 536KB
img7.jpg 516KB
deepface-detectors-v2.jpg 515KB
img13.jpg 511KB
tech-stack-v2.jpg 502KB
img4.jpg 463KB
img47.jpg 425KB
img41.jpg 416KB
img19.jpg 396KB
img2.jpg 339KB
img31.jpg 316KB
img9.jpg 265KB
img48.jpg 265KB
img24.jpg 261KB
embedding.jpg 259KB
stock-4.jpg 255KB
img30.jpg 251KB
stock-2.jpg 241KB
img32.jpg 239KB
img20.jpg 222KB
stock-1.jpg 219KB
model-portfolio-v8.jpg 216KB
detector-portfolio-v3.jpg 209KB
stock-3.jpg 201KB
img14.jpg 172KB
stock-6-v2.jpg 170KB
img59.jpg 168KB
img36.jpg 167KB
img15.jpg 158KB
img8.jpg 154KB
img28.jpg 154KB
img27.jpg 152KB
img18.jpg 148KB
img57.jpg 146KB
img10.jpg 135KB
img56.jpg 125KB
img42.jpg 118KB
img37.jpg 116KB
img45.jpg 104KB
img53.jpg 93KB
img34.jpg 82KB
img6.jpg 77KB
img29.jpg 75KB
img55.jpg 75KB
img38.jpg 74KB
img22.jpg 72KB
img67.jpg 68KB
deepface-api.jpg 62KB
img43.jpg 60KB
img11.jpg 55KB
img21.jpg 53KB
img61.jpg 50KB
img17.jpg 50KB
img44.jpg 45KB
img46.jpg 38KB
img50.jpg 37KB
img16.jpg 36KB
img5.jpg 34KB
img62.jpg 22KB
img25.jpg 21KB
img51.jpg 20KB
img12.jpg 19KB
deepface.postman_collection.json 6.15MB
LICENSE 1KB
README.md 21KB
deepface-icon-labeled.png 47KB
deepface-icon.png 20KB
patreon.png 4KB
Facenet.py 48KB
DeepFace.py 26KB
realtime.py 16KB
OpenFace.py 15KB
functions.py 8KB
Ensemble-Face-Recognition.py 7KB
unit_tests.py 7KB
api.py 6KB
ArcFace.py 4KB
FaceDetector.py 3KB
SsdWrapper.py 3KB
OpenCvWrapper.py 3KB
VGGFace.py 3KB
face-recognition-how.py 2KB
Emotion.py 2KB
MediapipeWrapper.py 2KB
共 128 条
- 1
- 2
Meta.Qing
- 粉丝: 2w+
- 资源: 121
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Semantic Color Palette 语义调色板Unity游戏开发插件资源unitypackage
- Low Poly Nature:Lush and Diverse Environments低聚自然郁郁Unity低多边形模型资源
- voc数据集是什么-我们如何使用voc数据集
- Edgar Pro-Procedural Level Generator程序关卡生成器Unity开发插件unitypackage
- 宝藏软件m3u8下载器\m3u8DL-CLI
- 三次样条插值的介绍-什么是三次样条插值原理
- http的一些相关介绍-对于我们来说什么是http
- 全卷积网络基于voc2012数据集简单pytorch实现
- pycharm的一些介绍-用于更好的学习python
- 基于C++的程序设计大赛天梯赛L2答案(天梯赛)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0