This repository contains testing code for the paper https://arxiv.org/abs/1804.06208 .
Original repository (https://github.com/Microsoft/human-pose-estimation.pytorch)
This demo created for quick-testing original models for mpii dataset (other datasets and models not tested) by your own images. My code draws joints, which founded by model, on your image and save it as another image. This code doesn't use any detection models, therefore searches joints by a center person of your image
- Python 3.6
- PyTorch 0.4.1 (should also work with 1.0, but not tested)
- (Optional) Install dependencies from original repository
- Download required models from original repository from step 8 of Installation
- Prepare image, that you want to use for testing
- run script:
python demo.py --cfg <path to cfg *.yaml> --image-file <path to image> [--save-transform-image] [--use-webcam] [--use-crop-mode] [--gpus <id> ] [--min-confidence-threshold <coef> ]
Description of args:
- cfg (only for demo.py) : You should choose config with the same name as a model, that you are want to use. This file includes different configs for these models. Your model and config must be placed in same directory
- model-file (only for openvino-demo.py) : You should set it to your *.xml model
- save-transform-image: You can set it for saving temp image after resizing and drawing bounding box (it works for webcam too)
- use-webcam : Use webcam for getting images for predict
- use-crop-mode : Use crop mode for cropping person, that are you want (after adding this parameter, you get a new window with your photo, where you should highlight a required zone)
- min-confidence-threshold : Minumal confidence threshold of joints, that will be drawing on image. Default: 0.5
Person for estimation must be at the center of image, else it can work wrong!
Example:
Bad positions:
Good position:
If you don't know, at the center of the image your person or not, you can use option --save-transform-image. After this, you get an image "transformed.jpg", where you can see a blue box. Your person must be into this box fully or most of the body
Examples: