/etos-simplepose

Real-time single person pose estimation.

Primary LanguagePython

etos-simplepose

  • simple pose estimation.

  • for real time and high efficiency:

    • only for single person pose estimation
    • using lightweight CPM and Hourglass model
    • Instead of normal convolution, inverted residuals (also known as Mobilenet V2) module has been used inside the model for real-time inference.
  • running this model with a normal pc webcam can achieve 15fps+ on ETOS system, with high accuracy.

Training

Dependencies:

  • Python3
  • TensorFlow >= 1.4
pip install -r requirements.txt

Dataset:

Training dataset available through google driver.

Unzip it will obtain the following file structure

$ tree -L 1 .
.
├── ai_challenger_train.json
├── ai_challenger_valid.json
├── train
└── valid

The traing dataset only contains single person images and it come from the competition of AI Challenger.

  • 22446 training examples
  • 1500 testing examples

the annotation was transferred into COCO format for using the data augument code from tf-pose-estimation respository. Beside, you also need to install cocoapi

Hyper-parameter

In training procedure, we use cfg file for passing the hyper-parameter.

Below is the content of mv2_hourglass.cfg.

[Train]
model: 'mv2_hourglass'
checkpoint: False
datapath: '~/data/ai_challenger'
imgpath: '~/data/'
visible_devices: '1'
multiprocessing_num: 16
max_epoch: 1000
lr: '0.001'
batchsize: 16
decay_rate: 0.95
input_width: 192
input_height: 192
n_kpoints: 14
scale: 4
identify_occlusion: False
modelpath: '~/data/trained/mv2_hourglass_deep/models'
logpath: '~/data/trained/mv2_hourglass_deep/log'
num_train_samples: 25000
per_update_tensorboard_step: 500
per_saved_model_step: 500
pred_image_on_tensorboard: False

The cfg not cover all the parameters of the model, there still have some parameters in the network_mv2_hourglass.py.

training

python3 train.py mv2_hourglass.cfg

Bechmark (PCKh)

Run the follow command to evaluate the value of your PCKh.

python3 src/benchmark.py --frozen_pb_path=hourglass/model-360000.pb \
--anno_json_path=~/data/ai_challenger/ai_challenger_valid.json \
--img_path=~/data \
--output_node_name=hourglass_out_3

pc webcam demo

python test.py

Reference


[1] Paper of Convolutional Pose Machines
[2] Paper of Stack Hourglass
[3] Paper of MobileNet V2
[4] Repository PoseEstimationForMobile
[5] Repository of tf-pose-estimation
[6] Devlope guide of TensorFlow Lite