Counting 3,039 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Aug. 20, 2018
Jul. 31, 2017


'Openpose' for human pose estimation have been implemented using Tensorflow. It also provides several variants that have made some changes to the network structure for real-time processing on the CPU or low-power embedded devices.

You can even run this on your macbook with descent FPS!

Original Repo(Caffe) :

CMU's Original Model
on Macbook Pro 15"
Mobilenet Variant
on Macbook Pro 15"
Mobilenet Variant
on Jetson TX2
cmu-model mb-model-macbook mb-model-tx2
~0.6 FPS ~4.2 FPS @ 368x368 ~10 FPS @ 368x368
2.8GHz Quad-core i7 2.8GHz Quad-core i7 Jetson TX2 Embedded Board

Implemented features are listed here : features

Important Updates

2018.5.21 Post-processing part is implemented in c++. It is required compiling the part. See: 2018.2.7 Arguments in script changed. Support dynamic input size.



You need dependencies below.

  • python3
  • tensorflow 1.4.1+
  • opencv3, protobuf, python3-tk



Clone the repo and install 3rd-party libraries.

$ git clone
$ cd tf-openpose
$ pip3 install -r requirements.txt

Build c++ library for post processing. See :

$ cd tf_pose/pafprocess
$ swig -python -c++ pafprocess.i && python3 build_ext --inplace

Package Install

Alternatively, you can install this repo as a shared package using pip.

$ git clone
$ cd tf-openpose
$ python install

Test installed package


python -c 'import tf_pose; tf_pose.infer(image="./images/p1.jpg")'


I have tried multiple variations of models to find optmized network architecture. Some of them are below and checkpoint files are provided for research purpose.

  • cmu

    • the model based VGG pretrained network which described in the original paper.
    • I converted Weights in Caffe format to use in tensorflow.
    • pretrained weight download
  • dsconv

    • Same architecture as the cmu version except for the depthwise separable convolution of mobilenet.
    • I trained it using 'transfer learning', but it provides not-enough speed and accuracy.
  • mobilenet

    • Based on the mobilenet paper, 12 convolutional layers are used as feature-extraction layers.
    • To improve on small person, minor modification on the architecture have been made.
    • Three models were learned according to network size parameters.
    • I published models which is not the best ones, but you can test them before you trained a model from the scratch.

Download Tensorflow Graph File(pb file)

Before running demo, you should download graph files. You can deploy this graph on your mobile or other platforms.

  • cmu (trained in 656x368)
  • mobilenet_thin (trained in 432x368)

CMU's model graphs are too large for git, so I uploaded them on an external cloud. You should download them if you want to use cmu's original model. Download scripts are provided in the model folder.

$ cd models/graph/cmu
$ bash

Inference Time

Dataset Model Inference Time
Macbook Pro i5 3.1G
Inference Time
Jetson TX2
Coco cmu 10.0s @ 368x368 OOM @ 368x368
5.5s @ 320x240
Coco dsconv 1.10s @ 368x368
Coco mobilenet_accurate 0.40s @ 368x368 0.18s @ 368x368
Coco mobilenet 0.24s @ 368x368 0.10s @ 368x368
Coco mobilenet_fast 0.16s @ 368x368 0.07s @ 368x368


Test Inference

You can test the inference feature with a single image.

$ python --model=mobilenet_thin --resize=432x368 --image=./images/p1.jpg

The image flag MUST be relative to the src folder with no "~", i.e:

--image ../../Desktop

Then you will see the screen as below with pafmap, heatmap, result and etc.


Realtime Webcam

$ python --model=mobilenet_thin --resize=432x368 --camera=0

Then you will see the realtime webcam screen with estimated poses as below. This Realtime Result was recored on macbook pro 13" with 3.1Ghz Dual-Core CPU.

Python Usage

This pose estimator provides simple python classes that you can use in your applications.

See or as references.

e = TfPoseEstimator(get_graph_path(args.model), target_size=(w, h))
humans = e.inference(image)
image = TfPoseEstimator.draw_humans(image, humans, imgcopy=False)

ROS Support

See : etcs/


See : etcs/




[2] Training Codes :

[3] Custom Caffe by Openpose :

[4] Keras Openpose :

[5] Keras Openpose2 :

Lifting from the deep

[1] Arxiv Paper :



[1] Original Paper :

[2] Pretrained model :


[1] Tensorpack :

Tensorflow Tips

[1] Freeze graph :

[2] Optimize graph :