• This repository has been archived on 15/Jun/2022
  • Stars
    star
    431
  • Rank 100,866 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created almost 7 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

Chainer version of Realtime Multi-Person Pose Estiamtion

Chainer_Realtime_Multi-Person_Pose_Estimation

This is an implementation of Realtime Multi-Person Pose Estimation with Chainer. The original project is here.

ζ—₯本θͺžη‰ˆ README

Results

Β 

This project is licensed under the terms of the license.

Content

  1. Converting caffe model
  2. Testing
  3. Training

Requirements

  • Python 3.0+
  • Chainer 2.0+
  • NumPy
  • Matplotlib
  • OpenCV

Convert Caffe model to Chainer model

The authors of the original implementation provide trained caffe model which you can use to extract model weights. Execute the following commands to download the trained model and convert it to npz file:

cd models
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/face/pose_iter_116000.caffemodel
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel
python convert_model.py posenet pose_iter_440000.caffemodel coco_posenet.npz
python convert_model.py facenet pose_iter_116000.caffemodel facenet.npz
python convert_model.py handnet pose_iter_102000.caffemodel handnet.npz
cd ..

Test using the trained model

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

python pose_detector.py posenet models/coco_posenet.npz --img data/person.png

If you have a gpu device, use the --gpu option.

python pose_detector.py posenet models/coco_posenet.npz --img data/person.png --gpu 0
Β 

Similarly, execute the following command for face estimation. The resulting image will be saved as result.png.

python face_detector.py facenet models/facenet.npz --img data/face.png
Β 

Similarly, execute the following command for hand estimation. The resulting image will be saved as result.png.

python hand_detector.py handnet models/handnet.npz --img data/hand.png
Β 

Similarly, you can detect all poses, faces and hands by executing the following command. The resulting image will be saved as result.png.

python demo.py --img data/dinner.png
Β 

If you have a web camera, you can execute the following cammand to run real-time demostration mode with the camera activated. Quit with the q key.

Real-time pose estimation:

python camera_pose_demo.py

Real-time face estimation:

python camera_face_demo.py

Train your model

This is a training procedure using COCO 2017 dataset.

Download COCO 2017 dataset

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

wget -P models http://www.robots.ox.ac.uk/%7Evgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel

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

Check data generator

Execute the following command to check randomly generated training images by generator. Please confirm that you can see the correct PAFs, Heatmaps, and masks on the clipped image.

python coco_data_loader.py

Train with COCO dataset

For each 1000 iterations, the recent weight parameters are saved as a weight file model_iter_1000.

python train_coco_pose_estimation.py --gpu 0

Test using your own trained model

Execute the following command with your own trained weight parameter file and the image file as arguments for inference. The resulting image will be saved as result.png.

python pose_detector.py posenet model_iter_1000 --img data/person.png

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

More Repositories

1

HandlerSocket-Plugin-for-MySQL

HandlerSocket is a NoSQL plugin for MySQL, working as a daemon inside the mysqld process, to accept tcp connections, and execute requests from clients. HandlerSocket does not support SQL queries; instead it supports simple CRUD operations on tables.
C++
1,132
star
2

PyTorch_YOLOv3

Implementation of YOLOv3 in PyTorch
Python
433
star
3

PacketProxy

A local proxy written in Java
Java
429
star
4

SRCNNKit

CoreML and Keras implementation of Super-Resolution Convolutional Neural Network (SRCNN)
Python
387
star
5

DeClang

An anti-hacking compiler forked from the ollvm (https://github.com/obfuscator-llvm/obfuscator)
379
star
6

HandyRL

HandyRL is a handy and simple framework based on Python and PyTorch for distributed reinforcement learning that is applicable to your own environments.
Python
282
star
7

Chainer_Mask_R-CNN

Implementation of Mask R-CNN in Chainer
Python
140
star
8

nota

Web application for image and video labeling and annotation
JavaScript
112
star
9

Anjin

Autopilot tool for games made with Unity
C#
99
star
10

unity-meta-check

A tool to check problems about meta files of Unity
Go
81
star
11

techcon_app

TechCon App
Dart
57
star
12

HEVCPlayerView

C++
46
star
13

android-modern-architecture-test-handson

Kotlin
30
star
14

codelabs

DeNAγŒδ½œζˆγƒ»ε…¬ι–‹γ—γ¦γ„γ‚‹γ‚³γƒΌγƒ‰γƒ©γƒœγ§γ™γ€‚
Kotlin
28
star
15

cocoa-checker

COCOA(Covid-19 Exposure Notification System in Japan) Signal Checker / COCOA(Covid-19ζŽ₯触璺θͺγ‚’γƒ—γƒͺ)ε‹•δ½œγƒγ‚§γƒƒγ‚«γƒΌ
HTML
25
star
16

aelog

App Engine Logger
Go
24
star
17

ChainerPruner

ChainerPruner: Channel Pruning framework for Chainer
Python
21
star
18

devfarm

Tools to control iOS and Android mobile apps across several device farms
Go
20
star
19

Face2Speech

20
star
20

setup-job-workspace-action

An action creating a virtual workspace directory for each job
TypeScript
20
star
21

tflite-runtime-builder

Build TensorFlow Lite runtime with GitHub Actions
20
star
22

thrush

Some useful additions to bluebird for Node.js
JavaScript
16
star
23

punctual

Redis-backed Node.js task queue for delayed job processing
JavaScript
15
star
24

dworker

Distributed worker system.
JavaScript
11
star
25

capistrano-net_storage

Capistrano Plugin for Fast Deployment via Remote Storage
Ruby
10
star
26

cloud-datastore-interceptor

Interceptors for Cloud Datastore
Go
10
star
27

Dena.CodeAnalysis.Testing

TDD friendly test helpers for Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer
C#
9
star
28

mysql_rewinder

Ruby
8
star
29

aehcl

App Engine Http Client
Go
7
star
30

mobilize-server

Mobilize-Server includes deployment scripts via Capistrano and scheduling via whenever.
Shell
7
star
31

FBStackableURLCache

A more pluggable version of Apple's NSURLCache. Implement a filtering webbrowser, or even your own version of Amazon Silk…
Objective-C
6
star
32

digdag-operator-bq-wait

Java
6
star
33

m_logger

Ruby
6
star
34

FBFramedScrollableView

UIView subclass that manages any type of UIKit scrollable view, automatically animating a header and footer as you scroll.
Objective-C
6
star
35

mobilize-base

Mobilize is a script deployment and data visualization framework with a Google Spreadsheets UI. Mobilize uses Resque for parallelization and queueuing, MongoDB for caching, and Google Drive for hosting, user input and display.
Ruby
6
star
36

rubycf

Ruby bindings for native Property List read/writing using Core Foundation or CFLite
C
5
star
37

asyncgraph

asyncgraph is a very simply module for controlling flow between asynchronous code.
JavaScript
5
star
38

IsarTutorial

Isabelle
4
star
39

PacketProxyPlugin

Plugins for PacketProxy
Java
4
star
40

ommonitor

Open Match Ticket Monitor
Go
4
star
41

mobilize-ssh

Mobilize-Ssh adds the power of ssh to mobilize-base.
Ruby
4
star
42

ubuntu22-mysql-q4m

Dockerfile
4
star
43

RoslynAnalyzerTemplate

C#
3
star
44

capistrano-deploy_locker

Capistrano Plugin to Lock Deployment
Ruby
3
star
45

redis_info

A Scout plugin to monitor redis by using the redis-cli info command
3
star
46

PacketProxyHub

Web service for sharing configs of PacketProxy
Java
3
star
47

Login-Toboggan-Android

Java
2
star
48

mobilize-hdfs

Adds hdfs support for mobilize-ssh
Ruby
2
star
49

kobold_ruby

Tools for working with and writing tests in Ruby, Rails and Sinatra
Ruby
2
star
50

capistrano-net_storage_demo

Example application for Capistrano::NetStorage
Ruby
1
star
51

aemw

App Engine Middleware
1
star
52

mobilize-hive

adds hive support to mobilize-hdfs
Ruby
1
star
53

unity-meta-check-bins

Pre-built binaries of unity-meta-check for Windows/Linux/macOS
Shell
1
star
54

capistrano-net_storage-s3

Capistrano::NetStorage Plugin for Deployment via Amazon S3
Ruby
1
star
55

Login-Toboggan-iOS

Objective-C
1
star
56

mono-login-sample

C#
1
star
57

mempatch

Memory tampering tool for security assessment
C++
1
star