A lightweight 2D Pose model can be deployed on Linux/Window/Android, supports CPU/GPU inference acceleration, and can be detected in real time on ordinary mobile phones.

Overview

Human-Pose-Estimation-Lite-cpp

这是轻量化版本的人体姿态估计(2D Pose)C++推理代码,推理框架使用TNN

  • 轻量化模型是基于MobileNet V2的改进版本
  • 使用COCO的数据集进行训练,也可以支持MPII数据
  • 支持OpenCL模型推理加速,在普通手机可实时检测
  • 该仓库并未集成人体检测模型,Pose检测输入是原图,使用人体检测框并进行裁剪,Pose检测效果会更好
  • 关于轻量化版本的人体检测检测模型,可参考Object-Detection-Lite-cpp
  • 纯C++版本速度比较慢,需要配置OpenCL方可实时检测
  • Python Demo 模型训练代码暂时未提供
  • Android Demo 已经集成了轻量化版本的人体检测模型人体姿态估计模型,在普通手机可实时检测
  • 博客《2D Pose人体关键点检测(Python/Android /C++ Demo)
2D Pose人体关键点检测 人脸检测+人脸关键点+人体检测
Android Demo
Android Demo Android Demo
CPU:70ms,GPU:50ms CPU/GPU<30ms

1.目录结构

.
├── 3rdparty
├── data
├── docs
├── src
├── build.sh
├── CMakeLists.txt
├── README.md
└── result.jpg

2.配置说明

(1)依赖库

(2)配置说明

  • 配置OpenCV(推荐opencv-4.3.0)
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make install
  • 配置OpenCL加速(可选)

Android系统一般都支持OpenCL,Linux系统可参考如下配置:

# 参考安装OpenCL: https://blog.csdn.net/qq_28483731/article/details/68235383,作为测试,安装`intel cpu版本的OpenCL`即可
# 安装clinfo,clinfo是一个显示OpenCL平台和设备的软件
sudo apt-get install clinfo
# 安装依赖
sudo apt install dkms xz-utils openssl libnuma1 libpciaccess0 bc curl libssl-dev lsb-core libicu-dev
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete
# 在intel官网上下载了intel SDK的tgz文件,并且解压
sudo sh install.sh

3.模型参数说明

  • 模型需要配置的参数如下:
struct ModelParam {
    float aspect_ratio;                //长宽比,一般为0.75
    float scale_ratio;                 //缩放比例,一般为1.25
    int input_width;                   //模型输入宽度,单位:像素
    int input_height;                  //模型输入高度,单位:像素
    bool use_udp;                      //是否使用无偏估计UDP,一般为false
    bool use_rgb;                      //是否使用RGB作为模型输入
    vector<float> bias;                //输入数据偏置:bias=-m/std
    vector<float> scale;               //输入数据归一化尺度:scale=1/std/255
    vector
   <
   float>> skeleton;    
   //关键点连接序号ID(用于可视化显示)
};
  

4.Demo

  • bash build.sh

5.COCO关键点说明

  • 关键点连接线序号(用于绘制图像)
skeleton =[[15, 13], [13, 11], [16, 14], [14, 12], [11, 12], [5, 11], [6, 12], [5, 6], [5, 7], [6, 8], [7, 9], [8, 10], [0, 1], [0, 2], [1, 3], [2, 4]]
  • 图像左右翻转时,成对的关键点(训练时用于数据增强)
flip_pairs=[[1, 2], [3, 4], [5, 6], [7, 8],[9, 10], [11, 12], [13, 14], [15, 16]]
  • 每个关键点序号对应人体关键点的意义
"keypoints": {
 0: "nose",
 1: "left_eye",
 2: "right_eye",
 3: "left_ear",
 4: "right_ear",
 5: "left_shoulder",
 6: "right_shoulder",
 7: "left_elbow",
 8: "right_elbow",
 9: "left_wrist",
 10: "right_wrist",
 11: "left_hip",
 12: "right_hip",
 13: "left_knee",
 14: "right_knee",
 15: "left_ankle",
 16: "right_ankle"
}

6.联系

  • [email protected]
  • 麻烦给个Star
  • 如果你觉得该帖子帮到你,还望贵人多多支持,鄙人会再接再厉,继续努力的~

You might also like...
Real-Time Neural 3D Hand Pose Estimation from an Event Stream [ICCV 2021]

EventHands: Real-Time Neural 3D Hand Pose Estimation from an Event Stream Project Page Index TRAIN.md -- how to train the model from scratch EVAL_REAL

Simple inference deep head pose ncnn version
Simple inference deep head pose ncnn version

ncnn-deep-head-pose Simple implement inference deep head pose ncnn version with high performance and optimized resource. This project based on deep-he

Real time eye tracking for embedded and mobile devices.
Real time eye tracking for embedded and mobile devices.

drishti Real time eye tracking for embedded and mobile devices in C++11. NEWS (2018/08/10) Native iOS, Android, and "desktop" variants of the real-tim

Tensors and Dynamic neural networks in Python with strong GPU acceleration
Tensors and Dynamic neural networks in Python with strong GPU acceleration

PyTorch is a Python package that provides two high-level features: Tensor computation (like NumPy) with strong GPU acceleration Deep neural networks b

NCNN+Int8+YOLOv4 quantitative modeling and real-time inference
NCNN+Int8+YOLOv4 quantitative modeling and real-time inference

NCNN+Int8+YOLOv4 quantitative modeling and real-time inference

🐸 Coqui STT is an open source Speech-to-Text toolkit which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers
🐸 Coqui STT is an open source Speech-to-Text toolkit which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers

Coqui STT ( 🐸 STT) is an open-source deep-learning toolkit for training and deploying speech-to-text models. 🐸 STT is battle tested in both producti

DeepSpeech is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers.

Project DeepSpeech DeepSpeech is an open-source Speech-To-Text engine, using a model trained by machine learning techniques based on Baidu's Deep Spee

Mobile Robot Programming Toolkit (MRPT) provides C++ libraries aimed at researchers in mobile robotics and computer vision
Mobile Robot Programming Toolkit (MRPT) provides C++ libraries aimed at researchers in mobile robotics and computer vision

The MRPT project 1. Introduction Mobile Robot Programming Toolkit (MRPT) provides C++ libraries aimed at researchers in mobile robotics and computer v

ncnn is a high-performance neural network inference framework optimized for the mobile platform
ncnn is a high-performance neural network inference framework optimized for the mobile platform

ncnn ncnn is a high-performance neural network inference computing framework optimized for mobile platforms. ncnn is deeply considerate about deployme

Owner
JinquanPan
Computer Vision Researcher
JinquanPan
A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support.

Libonnx A lightweight, portable pure C99 onnx inference engine for embedded devices with hardware acceleration support. Getting Started The library's

xboot.org 433 Nov 24, 2022
pose demo on android mobile based on PaddleDetection

pose_demo_android pose demo on android mobile based on PaddleDetection 本工程Android部分基于Paddle-Lite-Demo修改。 算法模型基于PaddleDetection的PP-TinyPose. 如欲获取更多详情,请

null 50 Dec 1, 2022
CTranslate2 is a fast inference engine for OpenNMT-py and OpenNMT-tf models supporting both CPU and GPU executio

CTranslate2 is a fast inference engine for OpenNMT-py and OpenNMT-tf models supporting both CPU and GPU execution. The goal is to provide comprehensive inference features and be the most efficient and cost-effective solution to deploy standard neural machine translation systems such as Transformer models.

OpenNMT 370 Nov 23, 2022
a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.

a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.

Tencent 1.2k Nov 23, 2022
Hardware-accelerated DNN model inference ROS2 packages using NVIDIA Triton/TensorRT for both Jetson and x86_64 with CUDA-capable GPU.

Isaac ROS DNN Inference Overview This repository provides two NVIDIA GPU-accelerated ROS2 nodes that perform deep learning inference using custom mode

NVIDIA Isaac ROS 52 Nov 24, 2022
A fast, scalable, high performance Gradient Boosting on Decision Trees library, used for ranking, classification, regression and other machine learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU.

Website | Documentation | Tutorials | Installation | Release Notes CatBoost is a machine learning method based on gradient boosting over decision tree

CatBoost 6.8k Nov 26, 2022
In this repo, we deployed SOLOv2 to TensorRT with C++.

Solov2-TensorRT-CPP in this repo, we deployed SOLOv2 to TensorRT with C++. See the video:https://www.bilibili.com/video/BV1rQ4y1m7mx Requirements Ubun

ChenJianqu 29 Nov 20, 2022
Pose-tensorflow - Human Pose estimation with TensorFlow framework

Human Pose Estimation with TensorFlow Here you can find the implementation of the Human Body Pose Estimation algorithm, presented in the DeeperCut and

Eldar Insafutdinov 1.1k Nov 23, 2022
Python and C++ implementation of "MarkerPose: Robust real-time planar target tracking for accurate stereo pose estimation". Accepted at LXCV Workshop @ CVPR 2021.

MarkerPose: Robust Real-time Planar Target Tracking for Accurate Stereo Pose Estimation This is a PyTorch and LibTorch implementation of MarkerPose: a

Jhacson Meza 47 Nov 18, 2022