A reimplementation of real time human pose estimation using Pytorch. Both CMU's original model and mobilenet version backbone are provided.
In order to speed up the code, instead of resizing heat maps and PAF maps to orignial input image, this code upsamples the feature map with factor 8 and then performed the NMS for peak location, bigartite grahps, line integral and grouping.
You can reach 15+ frames per second using GPU
CPU: Intel® Xeon(R) W-2123 @ 3.60GHz × 8
GPU: Nvidia Quadro P4000 8G
Input Video Size: 640x480
CMU's Original Model on CPU | Mobilenet on CPU |
---|---|
~4 FPS | ~8 FPS |
CMU's Original Model on GPU | Mobilenet on GPU |
---|---|
~10 FPS | ~15 FPS |
download the CMU pretrained weight, Mobilenet weight and put into "weights" folder
- image Demo
$ python Demo_picture.py -backbone {CMU or Mobilenet} -image {image path} -scale {scale to image} -show {}
- Video Demo
$ python Demo_video.py -backbone {CMU or Mobilenet} -video {video path} -scale {scale to image} -show {}
"-show" provides an option to show the image with skeleton or a specific part location
refer to Open_Pose_Step_by_Step.ipynb for detailed instruction on how to implement openpose algorithm