当前位置: 首页 > news >正文

C# Onnx Dense Face 3D人脸重建,人脸Mesh

效果

项目

代码

using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;namespace Onnx_Demo
{public partial class frmMain : Form{public frmMain(){InitializeComponent();}string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";string image_path = "";DateTime dt1 = DateTime.Now;DateTime dt2 = DateTime.Now;Mat image;private void button1_Click(object sender, EventArgs e){OpenFileDialog ofd = new OpenFileDialog();ofd.Filter = fileFilter;if (ofd.ShowDialog() != DialogResult.OK) return;pictureBox1.Image = null;pictureBox2.Image = null;textBox1.Text = "";image_path = ofd.FileName;pictureBox1.Image = new Bitmap(image_path);image = new Mat(image_path);}private void Form1_Load(object sender, EventArgs e){}private void button2_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "检测中,请稍等……";pictureBox2.Image = null;Application.DoEvents();image = new Mat(image_path);Detect_Face detect_net = new Detect_Face(0.7f);Face_Mesh mesh_net = new Face_Mesh("mesh");//choices=["dense", "mesh"]dt1 = DateTime.Now;List<BoxInfo> bboxes = detect_net.detect(image);foreach (var item in bboxes){mesh_net.detect(image, new List<BoxInfo>() { item });}dt2 = DateTime.Now;pictureBox2.Image = new Bitmap(image.ToMemoryStream());textBox1.Text = "推理耗时:" + (dt2 - dt1).TotalMilliseconds + "ms";}private void pictureBox2_DoubleClick(object sender, EventArgs e){Common.ShowNormalImg(pictureBox2.Image);}private void pictureBox1_DoubleClick(object sender, EventArgs e){Common.ShowNormalImg(pictureBox1.Image);}}
}

下载

源码下载

其他

C++ 3D人脸重建,人头姿势估计,人脸Mesh-CSDN博客

http://www.lryc.cn/news/220840.html

相关文章:

  • Java 8 新特性 Stream 的使用场景(不定期更新)
  • 公开IP属地信息如何保护用户的隐私?
  • 大桌子初步使用
  • 初步了解ORM框架之一Mybatis
  • 2023 electron最新最简版windows、mac打包、自动升级详解
  • Ubuntu18.04安装pcl-1.12.1,make时报错:/usr/bin/ld: cannot find -lvtkIOMPIImage
  • 表单验证不通过的一个点form中未定义这个字段
  • 最新、最全、最详细的 K8S 学习笔记总结
  • Emacs之高亮显示超过80个字符部分(一百三十)
  • C语言 每日一题 PTA 11.7 day13
  • 产品经理进阶:产品的起点是发现并理解问题
  • Java —— 类和对象(一)
  • RabbitMQ(高级特性)优先级队列
  • 盘点苹果手机导出照片到电脑的3个方法!
  • px、rpx、em以及rem的区别与用法
  • 类(class)
  • FPGA时序分析与约束(10)——生成时钟
  • A. Hit the Lottery
  • mvn: Downloading from pluginRepository
  • docker相关知识
  • Springboot 集成 RocketMQ(进阶-消息)
  • 10 索引优化与查询优化
  • linux PVE安装
  • ZZ038 物联网应用与服务赛题第J套
  • 【寒武纪(3)】媒体处理系统的系统控制、视频输入和后处理子系统
  • Linux下使用vscode编写Python项目
  • 使用 curator 连接 zookeeper 集群 Invalid config event received
  • 大促期间也要做好低价治理
  • 【c++】——类和对象(中)——默认成员函数(上)
  • 钉钉企业微应用开发C#-HTTP回调接口