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


    目录

    介绍

    效果

    模型信息

    项目

    代码

    下载

    其他


    介绍

    github地址:GitHub - cleardusk/3DDFA_V2: The official PyTorch implementation of Towards Fast, Accurate and Stable 3D Dense Face Alignment, ECCV 2020.

    Introduction
    This work extends 3DDFA, named 3DDFA_V2, titled Towards Fast, Accurate and Stable 3D Dense Face Alignment, accepted by ECCV 2020. The supplementary material is here. The gif above shows a webcam demo of the tracking result, in the scenario of my lab. This repo is the official implementation of 3DDFA_V2.

    Compared to 3DDFA, 3DDFA_V2 achieves better performance and stability. Besides, 3DDFA_V2 incorporates the fast face detector FaceBoxes instead of Dlib. A simple 3D render written by c++ and cython is also included. This repo supports the onnxruntime, and the latency of regressing 3DMM parameters using the default backbone is about 1.35ms/image on CPU with a single image as input. If you are interested in this repo, just try it on this google colab! Welcome for valuable issues, PRs and discussions 😄

    效果

    图片源自网络侵删 

    模型信息

    Inputs
    -------------------------
    name:input
    tensor:Float[-1, 3, 120, 120]
    ---------------------------------------------------------------

    Outputs
    -------------------------
    name:camera_matrix
    tensor:Float[-1, 3, 4]
    name:landmarks
    tensor:Float[-1, 38365, 3]
    ---------------------------------------------------------------

    项目

    代码

    1. using OpenCvSharp;
    2. using System;
    3. using System.Collections.Generic;
    4. using System.Drawing;
    5. using System.Windows.Forms;
    6. namespace Onnx_Demo
    7. {
    8. public partial class frmMain : Form
    9. {
    10. public frmMain()
    11. {
    12. InitializeComponent();
    13. }
    14. string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";
    15. string image_path = "";
    16. DateTime dt1 = DateTime.Now;
    17. DateTime dt2 = DateTime.Now;
    18. Mat image;
    19. private void button1_Click(object sender, EventArgs e)
    20. {
    21. OpenFileDialog ofd = new OpenFileDialog();
    22. ofd.Filter = fileFilter;
    23. if (ofd.ShowDialog() != DialogResult.OK) return;
    24. pictureBox1.Image = null;
    25. pictureBox2.Image = null;
    26. textBox1.Text = "";
    27. image_path = ofd.FileName;
    28. pictureBox1.Image = new Bitmap(image_path);
    29. image = new Mat(image_path);
    30. }
    31. private void Form1_Load(object sender, EventArgs e)
    32. {
    33. }
    34. private void button2_Click(object sender, EventArgs e)
    35. {
    36. if (image_path == "")
    37. {
    38. return;
    39. }
    40. textBox1.Text = "检测中,请稍等……";
    41. pictureBox2.Image = null;
    42. Application.DoEvents();
    43. image = new Mat(image_path);
    44. Detect_Face detect_net = new Detect_Face(0.7f);
    45. Face_Mesh mesh_net = new Face_Mesh("mesh");//choices=["dense", "mesh"]
    46. dt1 = DateTime.Now;
    47. List<BoxInfo> bboxes = detect_net.detect(image);
    48. foreach (var item in bboxes)
    49. {
    50. mesh_net.detect(image, new List<BoxInfo>() { item });
    51. }
    52. dt2 = DateTime.Now;
    53. pictureBox2.Image = new Bitmap(image.ToMemoryStream());
    54. textBox1.Text = "推理耗时:" + (dt2 - dt1).TotalMilliseconds + "ms";
    55. }
    56. private void pictureBox2_DoubleClick(object sender, EventArgs e)
    57. {
    58. Common.ShowNormalImg(pictureBox2.Image);
    59. }
    60. private void pictureBox1_DoubleClick(object sender, EventArgs e)
    61. {
    62. Common.ShowNormalImg(pictureBox1.Image);
    63. }
    64. }
    65. }

    下载

    源码下载

    其他

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

  • 相关阅读:
    狂神说MybatisPlus学习笔记
    Java截取(提取)子字符串(substring()),Java分割字符串(split())
    Postgresql源码(92)深入分析HOT更新
    grep和vim查找日志文件信息
    arm-2d头文件概述
    configs
    通过ES-Hadoop实现Hive读写Elasticsearch数据
    大数据行业现在工作好不好找?很难吗?
    Excel 每 N 行拼成一行
    watch与watchEffect的区别
  • 原文地址:https://blog.csdn.net/lw112190/article/details/134239669