2.9 KiB
2.9 KiB
origin github rep: https://github.com/serengil/deepface
(推荐:直接使用我提交的仓库代码,并按照教程安装。如果需要查看更改原作者的仓库,请注意:
我拉取的作者仓库的commit版本是: commit SHA: 09f325bc3706b8be70ab509a5a00843a6b6c5cdb ,请拉取或查看相同commit版本的原作者代码)
model store
model checkpoint 放在了 C:\Users\User\.deepface\weights
installation and setup (安装并启动)
$ 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]
web服务的url路径
http://your-host:your-port/docs#/
Model introduce
人脸识别所用的模型
推荐使用(推荐优先级同顺序):GhostFaceNet, ArcFace
Deepface is a hybrid face recognition package. It currently wraps many state-of-the-art face recognition models:
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% 不可用
The default configuration uses GhostFaceNet model.
推荐(优先级同顺序):retinaface, mtcnn, opencv, ssd
backends = {
"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'
}
这是计算不同人脸相似度时使用的函数,直接使用代码中默认的既可,无需更改
distance_metric = ['euclidean_l2','cosine','euclidean']
author: Euclidean L2 form seems to be more stable than cosine and regular Euclidean distance based on experiments.