Jiale/proj_deepface/readme.md

65 lines
2.9 KiB
Markdown
Raw Normal View History

2024-05-24 17:07:11 +08:00
origin github rep: https://github.com/serengil/deepface
(推荐:直接使用我提交的仓库代码,并按照教程安装。如果需要查看更改原作者的仓库,请注意:
我拉取的作者仓库的`commit`版本是: commit SHA: 09f325bc3706b8be70ab509a5a00843a6b6c5cdb ,请拉取或查看相同`commit`版本的原作者代码)
2024-05-22 17:16:30 +08:00
# model store
model checkpoint 放在了 `C:\Users\User\.deepface\weights`
2024-05-24 17:07:11 +08:00
# installation and setup (安装并启动)
2024-05-22 17:16:30 +08:00
```
2024-05-24 17:07:11 +08:00
$ conda create -n [your-env-name] python=3.7.16
$ conda activate [your-env-name]
$ cd ./deepface
$ pip install -e .
$ pip install "uvicorn[standard]"
$ cd ..
$ uvicorn webmain:app --port [your-port] --host [your-host]
2024-05-22 17:16:30 +08:00
```
2024-05-24 17:10:53 +08:00
web服务的url路径
2024-05-22 17:16:30 +08:00
```
2024-05-24 17:12:04 +08:00
http://your-host:your-port/docs#/
2024-05-22 17:16:30 +08:00
```
# Model introduce
```
2024-05-24 17:07:11 +08:00
人脸识别所用的模型
推荐使用(推荐优先级同顺序)GhostFaceNet, ArcFace
2024-05-22 17:16:30 +08:00
Deepface is a hybrid face recognition package. It currently wraps many state-of-the-art face recognition models:
2024-05-24 17:07:11 +08:00
model_name Declared LFW Score 是否可用 备注
VGG-Face 98.9% 可用
Facenet 99.2% 可用
Facenet512 99.6% 可用 效果似乎不好
OpenFace 92.9% 可用
DeepID 97.4% 可用
Dlib 99.3% 不可用
SFace 99.5% 可用
ArcFace 99.5% 可用 重点测试**(阈值应该可以设置小一点)
GhostFaceNet 99.7% 可用 重点测试**
Human-beings 97.5% 不可用
2024-05-22 17:16:30 +08:00
2024-05-24 17:07:11 +08:00
The default configuration uses GhostFaceNet model.
2024-05-22 17:16:30 +08:00
```
```
2024-05-24 17:07:11 +08:00
推荐(优先级同顺序)retinaface, mtcnn, opencv, ssd
2024-05-22 17:16:30 +08:00
backends = {
2024-05-24 17:07:11 +08:00
"opencv": OpenCv.OpenCvClient, 可用,效果一般,容易找不到人脸
"mtcnn": MtCnn.MtCnnClient, 可用,效果挺好
"ssd": Ssd.SsdClient, 可用,容易找到太多人脸
"dlib": Dlib.DlibClient, 不可用Dlib is an optional detector, ensure the library is installed.Please install using 'pip install dlib'
"retinaface": RetinaFace.RetinaFaceClient, 可用,效果挺好
"mediapipe": MediaPipe.MediaPipeClient, 未知MediaPipe is an optional detector, ensure the library is installed.Please install using 'pip install mediapipe'
"yolov8": Yolo.YoloClient, 不可用Yolo is an optional detector, ensure the library is installed. Please install using 'pip install ultralytics'
"yunet": YuNet.YuNetClient, 未知没下载model ck
"fastmtcnn": FastMtCnn.FastMtCnnClient, 不可用FastMtcnn is an optional detector, ensure the library is installed.Please install using 'pip install facenet-pytorch'
2024-05-22 17:16:30 +08:00
}
```
```
2024-05-24 17:07:11 +08:00
这是计算不同人脸相似度时使用的函数,直接使用代码中默认的既可,无需更改
2024-05-22 17:16:30 +08:00
distance_metric = ['euclidean_l2','cosine','euclidean']
author: Euclidean L2 form seems to be more stable than cosine and regular Euclidean distance based on experiments.
```