C#利用openvino部署PP-TinyPose人体姿态识别

【官方框架地址】

github.com/PaddlePaddle/PaddleDetection

【算法介绍】

关键点检测算法往往需要部署在轻量化、边缘端设备上,因此长期以来都存在一个难题:精度高、速度则慢、算法体积也随之增加。而PP-TinyPose的出世彻底打破了这个僵局,采用Top-Down的方式,先应用3.3M、150FPS的超轻量检测网络PP-PicoDet 检测出人体,再用基于Lite-HRNet的移动端优化模型,检测对应关键点,由此确保关键点检测的高精度 ,同时扩大数据集,减小输入尺寸,预处理与后处理加入AID、UDP和DARK等策略,保证模型的高性能 。实现速度在FP16下122FPS的情况下,精度也可达到51.8%AP,不仅比其他类似实现速度更快,精度更是提升了130%。

PP-TinyPose除了在日常关键点检测任务上拥有极强的通用性 ,针对小目标出现在大尺幅图像中的产业常见难题场景 完成一系列针对性的优化,从而对小目标进行关键点检测时,依然能保持同样的精度与速。更特别的是,PP-TinyPose还能同时实现多人关键点检测 ,且效果超强!不仅对于检测人数无限制 ,其速度和精度也依旧优秀!与开源界其他类似实现相比,检测人数、精度与性能上均有明显优势

【效果展示】

【实现部分代码】

复制代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenCvSharp;

namespace FIRC
{
    public partial class Form1 : Form
    {
        Mat src = new Mat();
        string det_onnx = Application.StartupPath + @"\weights\picodet_v2_s_320_pedestrian\picodet_s_320_lcnet_pedestrian.onnx";
        string pose_onnx = Application.StartupPath + @"\weights\tinypose_256_192\tinypose_256_192.onnx";
        TinyPoseManager tpm = new TinyPoseManager();
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "图文件(*.*)|*.jpg;*.png;*.jpeg;*.bmp";
            openFileDialog.RestoreDirectory = true;
            openFileDialog.Multiselect = false;
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
              
                src = Cv2.ImRead(openFileDialog.FileName);
                pictureBox1.Image = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(src);


            }


        }

        private void button2_Click(object sender, EventArgs e)
        {
            if(pictureBox1.Image==null)
            {
                return;
            }
            Stopwatch sw = new Stopwatch();
            sw.Start();
            var resultMat = tpm.Inference(src);
            sw.Stop();
            this.Text = "耗时" + sw.Elapsed.TotalSeconds + "秒";
            pictureBox2.Image= OpenCvSharp.Extensions.BitmapConverter.ToBitmap(resultMat); //Mat转Bitmap
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            tpm.LoadWeights(pose_onnx, det_onnx);

        }

        private void btn_video_Click(object sender, EventArgs e)
        {
 
  
        }
    }
}

【视频演示】

bilibili.com/video/BV1vC4y1e7QL/

【源码下载】

https://download.csdn.net/download/FL1623863129/88700131

【测试环境】

vs2019

netframework4.7.2或者netframework4.8

opencvsharp4.8.0

无需额外安装openvino运行库即可直接运行

【参考文献】

1\] [https://blog.csdn.net/PaddlePaddle/article/details/121623070](https://blog.csdn.net/PaddlePaddle/article/details/121623070 "https://blog.csdn.net/PaddlePaddle/article/details/121623070")

相关推荐
LplLpl1117 小时前
AI 算法竞赛通关指南:基于深度学习的图像分类模型优化实战
大数据·人工智能·机器学习
依米s17 小时前
各年度人工智能大会WAIC核心议题(持续更新)
人工智能·人工智能+·waic·人工智能大会+
python机器学习建模18 小时前
22篇经典金融风控论文复现(2025年11月更新)
人工智能·机器学习·论文·期刊·金融风控
Codebee18 小时前
深度解析AI编程技术:从原理到实践,手把手教你落地
人工智能·设计模式·开源
武汉唯众智创18 小时前
基于五级工的人工智能训练师教学解决方案
人工智能·ai·产教融合·人工智能训练师·五级工·ai训练师
执笔论英雄18 小时前
【RL】python协程
java·网络·人工智能·python·设计模式
你好~每一天19 小时前
未来3年,最值得拿下的5个AI证书!
数据结构·人工智能·算法·sqlite·hbase·散列表·模拟退火算法
老前端的功夫19 小时前
前端技术选型的理性之道:构建可量化的ROI评估模型
前端·javascript·人工智能·ubuntu·前端框架
Mxsoft61919 小时前
我发现区块链数据同步延迟,某次故障溯源卡顿,动态调整共识机制救场!
人工智能
m0_4889130119 小时前
小白也能懂!RAG技术让AI告别知识滞后,收藏学习
人工智能·学习·langchain·大模型·ai大模型·rag·大模型学习