posts/csharp-scrfd-opencv/ #4
Replies: 1 comment
-
评论可联系到作者 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
posts/csharp-scrfd-opencv/
scrfd官网介绍文档 目前最优秀的人脸检测算法 使用OpenCvSharp库来进行图片预处理以及模型推理 scrfd.onnx模型下载 如何使用 已发布到nuget 源码在github 1 dotnet add package FaceTrain.OpenCV 1 2 3 4 5 6 7 8 //读取模型文件 var modelBytes = File.ReadAllBytes("Resource\Model\SCRFD\scrfd_10g_kps.onnx"); //读取要检测的图片 var imgBytes = File.ReadAllBytes("Resource\Img\test.png"); //实例化网络 using var net = new FaceTrain.OpenCV.SCRFD(modelBytes); //执行推理拿到结果 var faces = net.Detection(imgBytes); 模型下载 官方模型是用pytorch框架训练的,需要使用scrfd2onnx.py将模型转换下 作者已经转换好了可以直接下载使用
https://laolaolulu.gitee.io/posts/csharp-scrfd-opencv/
Beta Was this translation helpful? Give feedback.
All reactions