All Projects → rwightman → Posenet Python

rwightman / Posenet Python

Licence: apache-2.0
A Python port of Google TensorFlow.js PoseNet (Real-time Human Pose Estimation)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Posenet Python

ICON
ICON: Implicit Clothed humans Obtained from Normals (CVPR 2022)
Stars: ✭ 641 (+83.14%)
Mutual labels:  human-pose-estimation
Pose Residual Network Pytorch
Code for the Pose Residual Network introduced in 'MultiPoseNet: Fast Multi-Person Pose Estimation using Pose Residual Network' paper https://arxiv.org/abs/1807.04067
Stars: ✭ 277 (-20.86%)
Mutual labels:  human-pose-estimation
Posefix release
Official TensorFlow implementation of "PoseFix: Model-agnostic General Human Pose Refinement Network", CVPR 2019
Stars: ✭ 296 (-15.43%)
Mutual labels:  human-pose-estimation
DeepVTB
🌌 OpenVTuber-虚拟アイドル共享计划 An application of real-time face and gaze analyzation via deep nerual networks.
Stars: ✭ 32 (-90.86%)
Mutual labels:  human-pose-estimation
BOA
Bilevel Online Adaptation for Human Mesh Reconstruction
Stars: ✭ 43 (-87.71%)
Mutual labels:  human-pose-estimation
V2v Posenet release
Official Torch7 implementation of "V2V-PoseNet: Voxel-to-Voxel Prediction Network for Accurate 3D Hand and Human Pose Estimation from a Single Depth Map", CVPR 2018
Stars: ✭ 286 (-18.29%)
Mutual labels:  human-pose-estimation
simple-HigherHRNet
Multi-person Human Pose Estimation with HigherHRNet in Pytorch
Stars: ✭ 122 (-65.14%)
Mutual labels:  human-pose-estimation
Lightweight Human Pose Estimation 3d Demo.pytorch
Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Stars: ✭ 331 (-5.43%)
Mutual labels:  human-pose-estimation
Expose
ExPose - EXpressive POse and Shape rEgression
Stars: ✭ 254 (-27.43%)
Mutual labels:  human-pose-estimation
Semgcn
The Pytorch implementation for "Semantic Graph Convolutional Networks for 3D Human Pose Regression" (CVPR 2019).
Stars: ✭ 290 (-17.14%)
Mutual labels:  human-pose-estimation
openpifpaf
Official implementation of "OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association" in PyTorch.
Stars: ✭ 900 (+157.14%)
Mutual labels:  human-pose-estimation
rmpe dataset server
Realtime Multi-Person Pose Estimation data server. Used as a training and validation data provider in training process.
Stars: ✭ 14 (-96%)
Mutual labels:  human-pose-estimation
Fast Human Pose Estimation.pytorch
Official pytorch Code for CVPR2019 paper "Fast Human Pose Estimation" https://arxiv.org/abs/1811.05419
Stars: ✭ 290 (-17.14%)
Mutual labels:  human-pose-estimation
DenseNet-human-pose-estimation
Using DenseNet for human pose estimation based on TensorFlow.
Stars: ✭ 34 (-90.29%)
Mutual labels:  human-pose-estimation
Deep High Resolution Net.pytorch
The project is an official implementation of our CVPR2019 paper "Deep High-Resolution Representation Learning for Human Pose Estimation"
Stars: ✭ 3,521 (+906%)
Mutual labels:  human-pose-estimation
PARE
Code for ICCV2021 paper PARE: Part Attention Regressor for 3D Human Body Estimation
Stars: ✭ 222 (-36.57%)
Mutual labels:  human-pose-estimation
3dmppe rootnet release
Official PyTorch implementation of "Camera Distance-aware Top-down Approach for 3D Multi-person Pose Estimation from a Single RGB Image", ICCV 2019
Stars: ✭ 276 (-21.14%)
Mutual labels:  human-pose-estimation
Pytorch Human Pose Estimation
Implementation of various human pose estimation models in pytorch on multiple datasets (MPII & COCO) along with pretrained models
Stars: ✭ 346 (-1.14%)
Mutual labels:  human-pose-estimation
Simple Hrnet
Multi-person Human Pose Estimation with HRNet in Pytorch
Stars: ✭ 299 (-14.57%)
Mutual labels:  human-pose-estimation
Tf Simplehumanpose
TensorFlow implementation of "Simple Baselines for Human Pose Estimation and Tracking", ECCV 2018
Stars: ✭ 291 (-16.86%)
Mutual labels:  human-pose-estimation

PoseNet Python

This repository contains a pure Python implementation (multi-pose only) of the Google TensorFlow.js Posenet model. For a (slightly faster) PyTorch implementation that followed from this, see (https://github.com/rwightman/posenet-pytorch)

I first adapted the JS code more or less verbatim and found the performance was low so made some vectorized numpy/scipy version of a few key functions (named _fast).

Further optimization is possible

  • The base MobileNet models have a throughput of 200-300 fps on a GTX 1080 Ti (or better)
  • The multi-pose post processing code brings this rate down significantly. With a fast CPU and a GTX 1080+:
    • A literal translation of the JS post processing code dropped performance to approx 30fps
    • My 'fast' post processing results in 90-110fps
  • A Cython or pure C++ port would be even better...

Install

A suitable Python 3.x environment with a recent version of Tensorflow is required.

Development and testing was done with Conda Python 3.6.8 and Tensorflow 1.12.0 on Linux.

Windows 10 with the latest (as of 2019-01-19) 64-bit Python 3.7 Anaconda installer was also tested.

If you want to use the webcam demo, a pip version of opencv (pip install opencv-python) is required instead of the conda version. Anaconda's default opencv does not include ffpmeg/VideoCapture support. Also, you may have to force install version 3.4.x as 4.x has a broken drawKeypoints binding.

A conda environment setup as below should suffice:

conda install tensorflow-gpu scipy pyyaml python=3.6
pip install opencv-python==3.4.5.20

Usage

There are three demo apps in the root that utilize the PoseNet model. They are very basic and could definitely be improved.

The first time these apps are run (or the library is used) model weights will be downloaded from the TensorFlow.js version and converted on the fly.

For all demos, the model can be specified with the '--model` argument by using its ordinal id (0-3) or integer depth multiplier (50, 75, 100, 101). The default is the 101 model.

image_demo.py

Image demo runs inference on an input folder of images and outputs those images with the keypoints and skeleton overlayed.

python image_demo.py --model 101 --image_dir ./images --output_dir ./output

A folder of suitable test images can be downloaded by first running the get_test_images.py script.

benchmark.py

A minimal performance benchmark based on image_demo. Images in --image_dir are pre-loaded and inference is run --num_images times with no drawing and no text output.

webcam_demo.py

The webcam demo uses OpenCV to capture images from a connected webcam. The result is overlayed with the keypoints and skeletons and rendered to the screen. The default args for the webcam_demo assume device_id=0 for the camera and that 1280x720 resolution is possible.

Credits

The original model, weights, code, etc. was created by Google and can be found at https://github.com/tensorflow/tfjs-models/tree/master/posenet

This port and my work is in no way related to Google.

The Python conversion code that started me on my way was adapted from the CoreML port at https://github.com/infocom-tpo/PoseNet-CoreML

TODO (someday, maybe)

  • More stringent verification of correctness against the original implementation
  • Performance improvements (especially edge loops in 'decode.py')
  • OpenGL rendering/drawing
  • Comment interfaces, tensor dimensions, etc
  • Implement batch inference for image_demo
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].