deploy insightface for face detection

bash 复制代码
conda create -n insightface python=3.8
conda activate insightface
pip install insightface
git clone https://github.com/deepinsight/insightface.git
cd insightface/python-package
pip install numpy opencv-python 
pip install onnxruntime-gpu
touch model_test.py
cd insightface/thirdparty/face3d/mesh/cython
python setup.py build_ext -i

the following codes for model_test.py

python 复制代码
import cv2
import numpy as np
import insightface
from insightface.app import FaceAnalysis
from insightface.data import get_image as ins_get_image

app = FaceAnalysis(providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
app.prepare(ctx_id=0, det_size=(640, 640))
img = ins_get_image('t1')
faces = app.get(img)
rimg = app.draw_on(img, faces)
cv2.imwrite("./t1_output.jpg", rimg)

then run python model_test.py, you will get the result.

For the video, you may modify model.test.py and set the input value as every frame.

相关推荐
qq_372906931 小时前
mysql用户无法访问存储过程权限提示_MySQL EXECUTE赋权方案
jvm·数据库·python
biubiubiu07061 小时前
python解释器安装
python
qq_392690662 小时前
如何正确解析含 HTML 实体的 XML 字符串并渲染为 HTML 表格
jvm·数据库·python
qq_414256572 小时前
SQL如何处理时间序列缺失值_利用窗口函数进行前后值填充
jvm·数据库·python
2301_803875613 小时前
CSS如何制作导航栏平滑移动_使用transition与left属性
jvm·数据库·python
茅盾体9 小时前
汽车零件订单自动同步系统方案
python
2401_883600259 小时前
golang如何理解weak pointer弱引用_golang weak pointer弱引用总结
jvm·数据库·python
FreakStudio9 小时前
和做工厂系统的印尼老哥,复刻了一套属于 MicroPython 的包管理系统
python·单片机·嵌入式·大学生·面向对象·并行计算·电子diy·电子计算机
2301_773553629 小时前
mysql如何评估SQL语句的索引开销_mysql性能追踪与分析
jvm·数据库·python
pele10 小时前
PHP源码运行受主板供电影响吗_供电相数重要性说明【技巧】
jvm·数据库·python