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")

相关推荐
AC赳赳老秦1 分钟前
2026国产大模型协同趋势:以DeepSeek为枢纽,构建高效智能协作网络
大数据·网络·人工智能·搜索引擎·交互·ai-native·deepseek
小鸡吃米…3 分钟前
自然语言处理 ——Python 实现
人工智能·python·自然语言处理
Alex艾力的IT数字空间3 分钟前
OCR 原理:从像素到文本的智能转换
数据结构·人工智能·python·神经网络·算法·cnn·ocr
FluxMelodySun5 分钟前
机器学习(二十) 集成学习-Boosting与Bagging集成方法
人工智能·机器学习·集成学习
李同学Lino5 分钟前
拒绝 500 元智商税!AutoClaw 零门槛安装教程,手把手教你低成本“喂龙虾”
人工智能·ai·github·openclaw·autoclaw
进击ing小白6 分钟前
OpenCv之多通道的分离与合并
人工智能·opencv·计算机视觉
李建军7 分钟前
OpenClaw 国内版快速安装指南 (2026 更新)
人工智能
菩提树下的凡夫11 分钟前
千问VL2.5大模型+Pyside6目标检测-连载6
人工智能·目标检测·计算机视觉
星幻元宇VR12 分钟前
VR生产安全学习机|开启智慧安全培训新时代
人工智能·科技·学习·安全·vr
程序媛小鱼12 分钟前
神经网络基础
人工智能·深度学习·神经网络