• Stars
    star
    145
  • Rank 254,144 (Top 6 %)
  • Language
    Python
  • Created about 6 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pytorch implementation of Openpose in Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields

Pytorch0.4.1_Realtime_Multi-Person_Pose_Estimation

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:

  1. Switching the Chainer backbone to Pytorch
  2. Pretrained models in pytorch are provided
  3. Chinese comments to better understanding the method

Content

  1. Converting caffe model
  2. Testing
  3. Training

Test using the trained model

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
Β 

Train your model

This is a training procedure using COCO 2017 dataset.

Download 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.

Setup COCO API

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

Generate and save image masks

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

Train with COCO dataset

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

Related repository

Citation

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}
  }