chrispolo / Keypoints-of-humanpose-with-Mask-R-CNN

Use the Mask RCNN for the human pose estimation
266 stars 90 forks source link

# Use the maskrcnn for the humanpose keypoints detection mask rcnn can be used to the human keypoints detection

Requirements

1、 Python3,Keras,TensorFlow。

2、MS COCO Requirements:

To train or test on MS COCO, you'll also need:

3、Download pre-trained COCO weights (mask_rcnn_coco_humanpose.h5) from the release page 4、(Optional) To train or test on MS COCO install pycocotools from one of these repos. They are forks of the original pycocotools with fixes for Python3 and Windows (the official repo doesn't seem to be active anymore).

Getting started

Training on coco keypoints

I am providing pre-trained weights for MS COCO 2017 kryoints to make it easier to start. You can use those weights as a starting point to train your own variation on the network. Training and evaluation code is in coco.py. You can import this module in Jupyter notebook (see the provided notebooks for examples) or you can run it directly from the command line as such:

# Train a new model starting from pre-trained COCO weights
python3 coco.py train --dataset=/path/to/coco/ --model=coco

# Train a new model starting from ImageNet weights
python3 coco.py train --dataset=/path/to/coco/ --model=imagenet

# Continue training a model that you had trained earlier
python3 coco.py train --dataset=/path/to/coco/ --model=/path/to/weights.h5

# Continue training the last model you trained. This will find
# the last trained weights in the model directory.
python3 coco.py train --dataset=/path/to/coco/ --model=last

You can also run the COCO evaluation code with:

# Run COCO evaluation on the last trained model
python3 coco.py evaluate --dataset=/path/to/coco/ --model=last

Training on your own datasets

Start by reading this blog post about the balloon color splash sample. It covers the process starting from annotating images to training to using the results in a sample application.

In summary, to train the model on your own dataset you'll need to extend two classes:

Config This class contains the default configuration. Subclass it and modify the attributes you need to change.

Dataset This class provides a consistent way to work with any dataset. It allows you to use new datasets for training without having to change the code of the model. It also supports loading multiple datasets at the same time, which is useful if the objects you want to detect are not all available in one dataset.

See examples in samples/shapes/train_shapes.ipynb, samples/coco/coco.py, samples/balloon/balloon.py, and samples/nucleus/nucleus.py.

Training process

train for 160k iterations, starting from a learning rate of 0.02 and reducing it by 10 at 60k and 80k iterations. I use bounding-box NMS with a threshold of 0.5.I use the Tesla P100 16g ,spent about 48 hours.

The results shows

humanestimtion humanestimation2

Suggestions

You can put your problems in the issues, we can solve it together Download the pretrained weights: https://pan.baidu.com/s/13V0n5m9ZU-ocbAks_GJwvw password: qx8f