Skip to content

Commit 75ea8eb

Browse files
Version 1.0.0: Hands added
1 parent 691693a commit 75ea8eb

47 files changed

Lines changed: 2332 additions & 315 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ LIB_BUILD_DIR := $(BUILD_DIR)/lib
3434
STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
3535
DYNAMIC_VERSION_MAJOR := 1
3636
DYNAMIC_VERSION_MINOR := 0
37-
DYNAMIC_VERSION_REVISION := 0-rc3
37+
DYNAMIC_VERSION_REVISION := 0
3838
DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
3939
#DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
4040
DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ OpenPose
66
- May 2017: Windows version released!
77
- Jun 2017: Face released!
88
- Jul 2017: Easier Windows installation!
9+
- Jul 2017: Hands released!
910
- Check all the [release notes](doc/release_notes.md).
1011
- Interested in an internship on CMU as OpenPose programmer? See [this link](https://docs.google.com/document/d/14SygG39NjIRZfx08clewTdFMGwVdtRu2acyCi3TYcHs/edit?usp=sharing) for details.
1112

@@ -14,7 +15,7 @@ OpenPose
1415
## Operating Systems
1516
1. **Ubuntu** 14 and 16.
1617
2. **Windows** 10.
17-
3. Other people have been able to install it on **Windows 7 and 8**, **Mac**, **CentOS**, and **Nvidia Jetson (TK1 and TX1)** embedded systems. However, we do not support them at the moment.
18+
3. Other people have been able to install it on **Windows 7 and 8**, **Mac**, **CentOS**, and **Nvidia Jetson (TK1 and TX1)** embedded systems. However, we do not officially support them at the moment.
1819

1920

2021

@@ -25,7 +26,7 @@ OpenPose is a **library for real-time multi-person keypoint detection and multi-
2526

2627
OpenPose represents the **first real-time system to jointly detect human body, hand and facial keypoints (in total 130 keypoints) on single images**. In addition, the system computational performance on body keypoint estimation is invariant to the number of detected people in the image.
2728

28-
OpenPose is freely available for free non-commercial use, and may be redistributed under these conditions. Please, see the [license](LICENSE) for further details. Contact [Yaser Sheikh](http://www.cs.cmu.edu/~yaser/) for commercial purposes.
29+
OpenPose is freely available for free non-commercial use, and may be redistributed under these conditions. Please, see the [license](LICENSE) for further details. For commercial purposes, contact [Yaser Sheikh](http://www.cs.cmu.edu/~yaser/).
2930

3031
In addition, OpenPose would not be possible without the [CMU Panoptic Studio](http://domedb.perception.cs.cmu.edu/).
3132

@@ -54,6 +55,11 @@ The pose estimation work is based on the C++ code from [the ECCV 2016 demo](http
5455

5556

5657
## Results
58+
### Body + Hands + Face Estimation
59+
<p align="center">
60+
<img src="doc/media/pose_face_hands.gif", width="480">
61+
</p>
62+
5763
### Body Estimation
5864
<p align="center">
5965
<img src="doc/media/dance.gif", width="480">
@@ -64,13 +70,6 @@ The pose estimation work is based on the C++ code from [the ECCV 2016 demo](http
6470
<img src="doc/media/pose_face.gif", width="480">
6571
</p>
6672

67-
## Coming Soon (But Already Working!)
68-
69-
### Body + Hands + Face Estimation
70-
<p align="center">
71-
<img src="doc/media/pose_face_hands.gif", width="480">
72-
</p>
73-
7473
### Body + Hands
7574
<p align="center">
7675
<img src="doc/media/pose_hands.gif", width="480">

doc/demo_overview.md

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ Each flag is divided into flag name, default value, and description.
2828
- DEFINE_string(resolution, "1280x720", "The image resolution (display and output). Use \"-1x-1\" to force the program to use the default images resolution.");
2929
- DEFINE_int32(num_gpu, -1, "The number of GPU devices to use. If negative, it will use all the available GPUs in your machine.");
3030
- DEFINE_int32(num_gpu_start, 0, "GPU device start number.");
31-
- DEFINE_int32(keypoint_scale, 0, "Scaling of the (x,y) coordinates of the final pose data array, i.e. the scale of the (x,y) coordinates that will be saved with the `write_keypoint` & `write_keypoint_json` flags. Select `0` to scale it to the original source resolution, `1`to scale it to the net output size (set with `net_resolution`), `2` to scale it to the final output size (set with `resolution`), `3` to scale it in the range [0,1], and 4 for range [-1,1]. Non related with `num_scales` and `scale_gap`.");
31+
- DEFINE_int32(keypoint_scale, 0, "Scaling of the (x,y) coordinates of the final pose data array, i.e. the scale of the (x,y) coordinates that will be saved with the `write_keypoint` & `write_keypoint_json` flags. Select `0` to scale it to the original source resolution, `1`to scale it to the net output size (set with `net_resolution`), `2` to scale it to the final output size (set with `resolution`), `3` to scale it in the range [0,1], and 4 for range [-1,1]. Non related with `scale_number` and `scale_gap`.");
3232
4. OpenPose Body Pose
3333
- DEFINE_string(model_pose, "COCO", "Model to be used (e.g. COCO, MPI, MPI_4_layers).");
3434
- DEFINE_string(net_resolution, "656x368", "Multiples of 16. If it is increased, the accuracy usually increases. If it is decreased, the speed increases.");
35-
- DEFINE_int32(num_scales, 1, "Number of scales to average.");
36-
- DEFINE_double(scale_gap, 0.3, "Scale gap between scales. No effect unless num_scales>1. Initial scale is always 1. If you want to change the initial scale, you actually want to multiply the `net_resolution` by your desired initial scale.");
35+
- DEFINE_int32(scale_number, 1, "Number of scales to average.");
36+
- DEFINE_double(scale_gap, 0.3, "Scale gap between scales. No effect unless scale_number > 1. Initial scale is always 1. If you want to change the initial scale, you actually want to multiply the `net_resolution` by your desired initial scale.");
3737
- DEFINE_bool(heatmaps_add_parts, false, "If true, it will add the body part heatmaps to the final op::Datum::poseHeatMaps array (program speed will decrease). Not required for our library, enable it only if you intend to process this information later. If more than one `add_heatmaps_X` flag is enabled, it will place then in sequential memory order: body parts + bkg + PAFs. It will follow the order on POSE_BODY_PART_MAPPING in `include/openpose/pose/poseParameters.hpp`.");
3838
- DEFINE_bool(heatmaps_add_bkg, false, "Same functionality as `add_heatmaps_parts`, but adding the heatmap corresponding to background.");
3939
- DEFINE_bool(heatmaps_add_PAFs, false, "Same functionality as `add_heatmaps_parts`, but adding the PAFs.");
@@ -42,23 +42,28 @@ Each flag is divided into flag name, default value, and description.
4242
- DEFINE_string(face_net_resolution, "368x368", "Multiples of 16. Analogous to `net_resolution` but applied to the face keypoint detector. 320x320 usually works fine while giving a substantial speed up when multiple faces on the image.");
4343
6. OpenPose Hand
4444
- DEFINE_bool(hand, false, "Enables hand keypoint detection. It will share some parameters from the body pose, e.g. `model_folder`.");
45-
- DEFINE_string(hand_net_resolution, "368x368", "Multiples of 16. Analogous to `net_resolution` but applied to the hand keypoint detector. 320x320 usually works fine while giving a substantial speed up when multiple hands on the image.");t_resolution` but applied to the hand keypoint detector.");
46-
- DEFINE_int32(hand_detection_mode, -1, "Set to 0 to perform 1-time keypoint detection (fastest), 1 for iterative detection (recommended for images and fast videos, slow method), 2 for tracking (recommended for webcam if the frame rate is >10 FPS per GPU used and for video, in practice as fast as 1-time detection), 3 for both iterative and tracking (recommended for webcam if the resulting frame rate is still >10 FPS and for video, ideally best result but slower), or -1 (default) for automatic selection (fast method for webcam, tracking for video and iterative for images).");
45+
- DEFINE_string(hand_net_resolution, "368x368", "Multiples of 16. Analogous to `net_resolution` but applied to the hand keypoint detector.");
46+
- DEFINE_int32(hand_scale_number, 1, "Analogous to `scale_number` but applied to the hand keypoint detector. Our best results were found with `hand_scale_number` = 6 and `hand_scale_range` = 0.4");
47+
- DEFINE_double(hand_scale_range, 0.4, "Analogous purpose than `scale_gap` but applied to the hand keypoint detector. Total range between smallest and biggest scale. The scales will be centered in ratio 1. E.g. if scaleRange = 0.4 and scalesNumber = 2, then there will be 2 scales, 0.8 and 1.2.");
48+
- DEFINE_bool(hand_tracking, false, "Adding hand tracking might improve hand keypoints detection for webcam (if the frame rate is high enough, i.e. >7 FPS per GPU) and video. This is not person ID tracking, it simply looks for hands in positions at which hands were located in previous frames, but it does not guarantee the same person ID among frames");
4749
7. OpenPose Rendering
4850
- DEFINE_int32(part_to_show, 0, "Part to show from the start.");
4951
- DEFINE_bool(disable_blending, false, "If blending is enabled, it will merge the results with the original frame. If disabled, it will only display the results.");
5052
8. OpenPose Rendering Pose
53+
- DEFINE_double(render_threshold, 0.05, "Only estimated keypoints whose score confidences are higher than this threshold will be rendered. Generally, a high threshold (> 0.5) will only render very clear body parts; while small thresholds (~0.1) will also output guessed and occluded keypoints, but also more false positives (i.e. wrong detections).");
5154
- DEFINE_int32(render_pose, 2, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering (slower but greater functionality, e.g. `alpha_X` flags). If rendering is enabled, it will render both `outputData` and `cvOutputData` with the original image and desired body part to be shown (i.e. keypoints, heat maps or PAFs).");
5255
- DEFINE_double(alpha_pose, 0.6, "Blending factor (range 0-1) for the body part rendering. 1 will show it completely, 0 will hide it. Only valid for GPU rendering.");
5356
- DEFINE_double(alpha_heatmap, 0.7, "Blending factor (range 0-1) between heatmap and original frame. 1 will only show the heatmap, 0 will only show the frame. Only valid for GPU rendering.");
5457
9. OpenPose Rendering Face
55-
- DEFINE_int32(render_face, -1, "Analogous to `render_pose` but applied to the face. Extra option: -1 to use the same configuration that `render_pose` is using.");
56-
- DEFINE_double(alpha_face, 0.6, "Analogous to `alpha_pose` but applied to face.");
57-
- DEFINE_double(alpha_heatmap_face, 0.7, "Analogous to `alpha_heatmap` but applied to face.");
58+
- DEFINE_double(face_render_threshold, 0.4, "Analogous to `render_threshold`, but applied to the face keypoints.");
59+
- DEFINE_int32(face_render, -1, "Analogous to `render_pose` but applied to the face. Extra option: -1 to use the same configuration that `render_pose` is using.");
60+
- DEFINE_double(face_alpha_pose, 0.6, "Analogous to `alpha_pose` but applied to face.");
61+
- DEFINE_double(face_alpha_heatmap, 0.7, "Analogous to `alpha_heatmap` but applied to face.");
5862
10. OpenPose Rendering Hand
59-
- DEFINE_int32(render_hand, -1, "Analogous to `render_pose` but applied to the hand. Extra option: -1 to use the same configuration that `render_pose` is using.");
60-
- DEFINE_double(alpha_hand, 0.6, "Analogous to `alpha_pose` but applied to hand.");
61-
- DEFINE_double(alpha_heatmap_hand, 0.7, "Analogous to `alpha_heatmap` but applied to hand.");
63+
- DEFINE_double(hand_render_threshold, 0.2, "Analogous to `render_threshold`, but applied to the hand keypoints.");
64+
- DEFINE_int32(hand_render, -1, "Analogous to `render_pose` but applied to the hand. Extra option: -1 to use the same configuration that `render_pose` is using.");
65+
- DEFINE_double(hand_alpha_pose, 0.6, "Analogous to `alpha_pose` but applied to hand.");
66+
- DEFINE_double(hand_alpha_heatmap, 0.7, "Analogous to `alpha_heatmap` but applied to hand.");
6267
11. Display
6368
- DEFINE_bool(fullscreen, false, "Run in full-screen mode (press f during runtime to toggle).");
6469
- DEFINE_bool(process_real_time, false, "Enable to keep the original source frame rate (e.g. for video). If the processing time is too long, it will skip frames. If it is too fast, it will slow it down.");
@@ -76,7 +81,7 @@ Each flag is divided into flag name, default value, and description.
7681
- DEFINE_string(write_heatmaps_format, "png", "File extension and format for `write_heatmaps`, analogous to `write_images_format`. Recommended `png` or any compressed and lossless format.");
7782

7883
## Multiple Scales
79-
Running at multiple scales might drastically slow down the speed, but it will increase the accuracy. Given the CNN input size (set with `net_resolution`), `num_scales` and `scale_gap` configure the number of scales to use and the gap between them, respectively. For instance, `--num_scales 3 --scale_gap 0.15` means using 3 scales at resolution: (1), (1-0.15) and (1-2*0.15) times the `net_resolution`.
84+
Running at multiple scales might drastically slow down the speed, but it will increase the accuracy. Given the CNN input size (set with `net_resolution`), `scale_number` and `scale_gap` configure the number of scales to use and the gap between them, respectively. For instance, `--scale_number 3 --scale_gap 0.15` means using 3 scales at resolution: (1), (1-0.15) and (1-2*0.15) times the `net_resolution`.
8085

8186
## Heat Maps Storing
8287
The following command will save all the body part heat maps, background heat map and Part Affinity Fields (PAFs) in the folder `output_heatmaps_folder`. It will save them on PNG format. Instead of individually saving each of the 67 heatmaps (18 body parts + background + 2 x 19 PAFs) individually, the library concatenate them vertically into a huge (width x #heatmaps) x (height) matrix. The PAFs channels are multiplied by 2 because there is one heatmpa for the x-coordinates and one for the y-coordinates. The order is body parts + bkg + PAFs. It will follow the sequence on POSE_BODY_PART_MAPPING in [include/openpose/pose/poseParameters.hpp](../include/openpose/pose/poseParameters.hpp).
@@ -102,7 +107,7 @@ Please, in order to check all the real time pose demo options and their details,
102107
- `--part_to_show`: Select the prediction channel to visualize (default: 0). 0 to visualize all the body parts, 1-18 for each body part heat map, 19 for the background heat map, 20 for all the body part heat maps together, 21 for all the PAFs, 22-69 for each body part pair PAF.
103108
- `--no_display`: Display window not opened. Useful if there is no X server and/or to slightly speed up the processing if visual output is not required.
104109
- `--num_gpu 2 --num_gpu_start 1`: Parallelize over this number of GPUs starting by the desired device id. Default `num_gpu` is -1, which will use all the available GPUs.
105-
- `--num_scales 3 --scale_gap 0.15`: Use 3 scales, 1, (1-0.15), (1-0.15*2). Default is one scale. If you want to change the initial scale, you actually want to multiply your desired initial scale by the `net_resolution`.
110+
- `--scale_number 3 --scale_gap 0.15`: Use 3 scales, 1, (1-0.15), (1-0.15*2). Default is one scale. If you want to change the initial scale, you actually want to multiply your desired initial scale by the `net_resolution`.
106111
- `--net_resolution 656x368 --resolution 1280x720`: For HD images and video (default values).
107112
- `--net_resolution 496x368 --resolution 640x480`: For VGA images and video.
108113
- `--model_pose MPI`: It will use MPI (15 body keypoints). Default: COCO (18 body keypoints). MPI is slightly faster. The variation `MPI_4_layers` sacrifies accuracy in order to further increase speed.
@@ -111,29 +116,15 @@ Please, in order to check all the real time pose demo options and their details,
111116

112117

113118
## Hands
114-
Very important note, use `hand_detection_mode` accordingly.
115119
```
116-
# Images
117120
# Fast method for speed
118-
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 0
119-
# Iterative for higher accuracy
120-
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 1
121-
122-
# Video
123-
# Iterative tracking for higher accuracy
124-
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_detection_mode 3
125-
# Tracking for speed
126-
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_detection_mode 2
127-
128-
# Webcam
129-
# Fast method for speed if the frame rate is low
130-
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 0
131-
# Iterative for higher accuracy (but the frame rate will be reduced)
132-
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 1
133-
# Tracking for higher accuracy if the frame rate is high enough. Worse results than fast method if frame rate is low
134-
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 2
135-
# Iterative + tracking for best accuracy if frame rate is high enough. Worse results than fast method if frame rate is low
136-
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 3
121+
./build/examples/openpose/openpose.bin --hand
122+
# Best results found with 6 scales
123+
./build/examples/openpose/openpose.bin --hand --hand_scale_number 6 --hand_scale_range 0.4
124+
# Adding tracking to Webcam (if FPS per GPU > 10 FPS) and Video
125+
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_tracking
126+
# Multi-scale + tracking is also possible
127+
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_scale_number 6 --hand_scale_range 0.4 --hand_tracking
137128
```
138129

139130

@@ -158,9 +149,9 @@ Very important note, use `hand_detection_mode` accordingly.
158149
## Rendering Face without Pose
159150
```
160151
# CPU rendering (faster)
161-
./build/examples/openpose/openpose.bin --face --render_pose 0 --render_face 1
152+
./build/examples/openpose/openpose.bin --face --render_pose 0 --face_render 1
162153
# GPU rendering
163-
./build/examples/openpose/openpose.bin --face --render_pose 0 --render_face 2
154+
./build/examples/openpose/openpose.bin --face --render_pose 0 --face_render 2
164155
```
165156

166157

doc/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ OpenPose Library - Compilation and Installation
1717
- At least 2 GB of free RAM memory.
1818
- Highly recommended: A CPU with at least 8 cores.
1919

20-
Note: These requirements assume the default configuration (i.e. `--net_resolution "656x368"` and `num_scales 1`). You might need more (with a greater net resolution and/or number of scales) or less resources (with smaller net resolution and/or using the MPI and MPI_4 models).
20+
Note: These requirements assume the default configuration (i.e. `--net_resolution "656x368"` and `scale_number 1`). You might need more (with a greater net resolution and/or number of scales) or less resources (with smaller net resolution and/or using the MPI and MPI_4 models).
2121

2222

2323

doc/output.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ There are 3 different keypoint Array<float> elements on this class:
6868
const auto y = poseKeypoints[{person, part, 1}];
6969
const auto score = poseKeypoints[{person, part, 2}];
7070
// Slightly more efficient version
71-
// If you want to access these elements on a huge loop, it is slightly faster (but usually not faster enough to be worthy) to get the index by your own
71+
// If you want to access these elements on a huge loop, you can get the index
72+
// by your own, but it is usually not faster enough to be worthy
7273
const auto baseIndex = poseKeypoints.getSize(2)*(person*numberBodyParts + part);
7374
const auto x = poseKeypoints[baseIndex];
7475
const auto y = poseKeypoints[baseIndex + 1];

0 commit comments

Comments
 (0)