This is an implementation of Realtime Multi-Person Pose Estimation with Pytorch. The original project is here.
This repo is mainly based on the Chainer Implementation from DeNA.
This project is licensed under the terms of the license
Some contributions are:
- Switching the Chainer backbone to Pytorch
- Pretrained models in pytorch are provided
- Chinese comments to better understanding the method
Download the following pretrained models to models
folder
posenet.pth : @Google Drive @One Drive
facenet.pth : @Google Drive @One Drive
handnet.pth : @Google Drive @One Drive
Execute the following command with the weight parameter file and the image file as arguments for estimating pose.
The resulting image will be saved as result.jpg
.
python pose_detect.py models/posenet.pth -i data/football.jpg
Similarly, execute the following command for face estimation.
The resulting image will be saved as result.png
.
python face_detector.py models/facenet.pth -i data/face.png
Similarly, execute the following command for hand estimation.
The resulting image will be saved as result.jpg
.
python hand_detector.py models/handnet.pth -i data/hand.jpg
This is a training procedure using COCO 2017 dataset.
cd data
bash getData.sh
If you already downloaded the dataset by yourself, please skip this procedure and change coco_dir in entity.py
to the dataset path that was already downloaded.
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI/
make
python setup.py install
cd ../../
Download VGG-19 pretrained model to models
folder
Mask images are created in order to filter out people regions who were not labeled with any keypoints.
vis
option can be used to visualize the mask generated from each image.
python gen_ignore_mask.py
For each 1000 iterations, the recent weight parameters are saved as a weight file model_iter_1000
.
python train.py
More configuration about training are in the entity.py
file
- CVPR'16, Convolutional Pose Machines.
- CVPR'17, Realtime Multi-Person Pose Estimation.
Please cite the original paper in your publications if it helps your research:
@InProceedings{cao2017realtime,
title = {Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields},
author = {Zhe Cao and Tomas Simon and Shih-En Wei and Yaser Sheikh},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2017}
}