-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用更高效、更准确的insightface模型教程 #16
Comments
mt-photos-insightface-unofficial-exe.zip 也可以从这里下载 https://github.com/dev-fox-101/mt-photos-insightface-unofficial/releases/tag/1.0.0 |
请问下这个有cuda版本吗? |
或者cuda的应该怎么打包镜像 |
dockerfile里,把最上面的 基础镜像改下;
应该就可以打包了 |
试了可行,同时要在添加python的包 |
感谢! |
确实比较精准了。 |
试了下 cuda 编译,Dockerfile如果只是替换 FROM 还是会只用 CPU 跑,还需要安装python ;然后 requirement 里onnxruntime替换成onnxruntime-gpu,再加一个python-multipart。现在实测是可以在 GPU 上跑起来了 |
可以分享下dockerfile吗,我按这个写,一直报错。 |
root:~/mt-photos-insightface-unofficial# cat Dockerfile
root:~/mt-photos-insightface-unofficial# cat requirements.txt
不知道能不能通用,我这里是可以跑的 |
2024-09-03 17:58:31 Traceback (most recent call last): 我这个docker运行会出现这个报错。。 |
mac arm的话,可以用么? |
纯小白问一下window版 |
你好,非常不错的项目。我是使用cuda版本,请问这个docker的server.py能不能优化一下让它仅在人脸识别运行的时候才调用GPU资源,否则释放显存。多数人都是在nas上部署此类项目追求低功耗,目前的docker只要开着就一定调用GPU,一是浪费计算资源和显存。二是显卡保持唤醒不能休眠,增加了功耗。实际人脸识别运行时间占比全天时间很少。 |
kqstone 大佬已经集成了insightface的模型
https://github.com/kqstone/mt-photos-insightface-unofficial
insightface是开源中准确率最高的预训练模型,特别是针对亚洲人脸型,比官方仓库使用的Facenet512准确率高很多
可以大幅改善识别完成后,一个人物被识别为多个人物的情况;
使用方法:
Docker容器运行
docker-compose模板
API配置参数
人脸置信度阈值设置 建议填 0.65
人脸匹配差异度阈值 建议填 0.5
无法下载镜像
以下2个镜像已内置 buffalo_l 模型
可以使用这个国内的地址拉取镜像
第1条命令为拉取镜像
第2条命令为将镜像标记为Docker hub源,这样可以在图形化创建容器时使用
armV8版本镜像
启动容器后,测试api提示不是人脸识别API
第一次启动容器后需要下载模型,如果由于网络问题,下载失败,可以按下面的方法手动下载镜像
1、创建容器时,要映射 /root/.insightface/models 这个目录
2、将模型文件 buffalo_l.zip 解压到映射的目录中;
模型文件下载地址:https://github.com/kqstone/mt-photos-insightface-unofficial/releases/tag/models
或者百度网盘:https://pan.baidu.com/s/1SsY7_2t7aORh2jCvGWtD1A?pwd=1234
比如目录映射为: -v /mnt/docker/insightface/models:/root/.insightface/models
需要把buffalo_l.zip的文件解压到/mnt/docker/insightface/models/buffalo_l
解压完成后,在 /mnt/docker/insightface/models/buffalo_l 下面可以看到 1k3d68.onnx、2d106det.onnx、det_10g.onnx、genderage.onnx、w600k_r50.onnx 5个文件
创建容器的完整命令:
docker run -i -p 8066:8066 -e API_AUTH_KEY=mt_photos_ai_extra -v /mnt/docker/insightface/models:/root/.insightface/models --name mt-photos-insightface-unofficial --restart="unless-stopped" kqstone/mt-photos-insightface-unofficial:latest
Windows如何使用
参考官方Windows版本的pyinstaller打包,我将kqstone/mt-photos-insightface-unofficial仓库的代码打包为Windows可以直接运行的exe文件
下载附件中的 mt-photos-insightface-unofficial-exe.zip 压缩包,解压后查看内部的 使用说明.txt
API配置参数
人脸置信度阈值设置 建议填 0.65
人脸匹配差异度阈值 建议填 0.5
Windows版本及模型下载
百度网盘:
https://pan.baidu.com/s/1SsY7_2t7aORh2jCvGWtD1A?pwd=1234
The text was updated successfully, but these errors were encountered: