Skip to content

Commit 5d8dcd5

Browse files
Improved doc
1 parent e653b5e commit 5d8dcd5

File tree

3 files changed

+76
-64
lines changed

3 files changed

+76
-64
lines changed

README.md

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -139,70 +139,12 @@ doxygen doc_autogeneration.doxygen
139139

140140

141141
## Output
142-
#### Output Format
143-
There are 2 alternatives to save the **(x,y,score) body part locations**. The `write_keypoint` flag uses the OpenCV cv::FileStorage default formats (JSON, XML and YML). However, the JSON format is only available after OpenCV 3.0. Hence, `write_keypoint_json` saves the people pose data using a custom JSON writer. For the latter, each JSON file has a `people` array of objects, where each object has an array `body_parts` containing the body part locations and detection confidence formatted as `x1,y1,c1,x2,y2,c2,...`. The coordinates `x` and `y` can be normalized to the range [0,1], [-1,1], [0, source size], [0, output size], etc., depending on the flag `keypoint_scale`. In addition, `c` is the confidence in the range [0,1].
144-
145-
```
146-
{
147-
"version":0.1,
148-
"people":[
149-
{"body_parts":[1114.15,160.396,0.846207,...]},
150-
{"body_parts":[...]},
151-
]
152-
}
153-
```
154-
155-
The body part order of the COCO (18 body parts) and MPI (15 body parts) keypoints is described in `POSE_BODY_PART_MAPPING` in [include/openpose/pose/poseParameters.hpp](include/openpose/pose/poseParameters.hpp). E.g., for COCO:
156-
```
157-
POSE_COCO_BODY_PARTS {
158-
{0, "Nose"},
159-
{1, "Neck"},
160-
{2, "RShoulder"},
161-
{3, "RElbow"},
162-
{4, "RWrist"},
163-
{5, "LShoulder"},
164-
{6, "LElbow"},
165-
{7, "LWrist"},
166-
{8, "RHip"},
167-
{9, "RKnee"},
168-
{10, "RAnkle"},
169-
{11, "LHip"},
170-
{12, "LKnee"},
171-
{13, "LAnkle"},
172-
{14, "REye"},
173-
{15, "LEye"},
174-
{16, "REar"},
175-
{17, "LEar"},
176-
{18, "Bkg"},
177-
}
178-
```
179-
180-
For the **heat maps storing format**, instead of individually saving each of the 67 heatmaps (18 body parts + background + 2 x 19 PAFs) individually, the library concatenates them into a huge (width x #heat maps) x (height) matrix, i.e. it concats the heat maps by columns. E.g., columns [0, individual heat map width] contains the first heat map, columns [individual heat map width + 1, 2 * individual heat map width] contains the second heat map, etc. Note that some image viewers are not able to display the resulting images due to the size. However, Chrome and Firefox are able to properly open them.
181-
182-
The saving order is body parts + background + PAFs. Any of them can be disabled with program flags. If background is disabled, then the final image will be body parts + PAFs. The body parts and background follow the order of `POSE_COCO_BODY_PARTS` or `POSE_MPI_BODY_PARTS`, while the PAFs follow the order specified on POSE_BODY_PART_PAIRS in `poseParameters.hpp`. E.g., for COCO:
183-
```
184-
POSE_COCO_PAIRS {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17, 2,16, 5,17};
185-
```
186-
187-
Where each index is the key value corresponding to each body part in `POSE_COCO_BODY_PARTS`, e.g., 0 for "Neck", 1 for "RShoulder", etc.
188-
189-
#### Reading Saved Results
190-
We use standard formats (JSON, XML, PNG, JPG, ...) to save our results, so there will be lots of frameworks to read them later, but you might also directly use our functions in [include/openpose/filestream.hpp](include/openpose/filestream.hpp). In particular, `loadData` (for JSON, XML and YML files) and `loadImage` (for image formats such as PNG or JPG) to load the data into cv::Mat format.
191-
192-
#### Pose Output Format
193-
<p align="center">
194-
<img src="doc/media/keypoints_pose.png", width="480">
195-
</p>
196-
197-
#### Face Output Format
198-
<p align="center">
199-
<img src="doc/media/keypoints_face.png", width="480">
200-
</p>
142+
Check the output (format, keypoint index ordering, etc.) in [doc/output.md](doc/output.md).
201143

202144

203145

204-
## OpenPose Benchmark
205-
Initial library running time benchmark on [OpenPose Benchmark](https://docs.google.com/spreadsheets/d/1-DynFGvoScvfWDA1P4jDInCkbD4lg0IKOYbXgEq0sK0/edit#gid=0). You can comment in that document with your graphics card model and running time for that model, and we will add your results to the benchmark!
146+
## Speed Up OpenPose and Benchmark
147+
Check the OpenPose Benchmark and some hints to speed up OpenPose on [doc/installation.md#faq](doc/installation.md#faq).
206148

207149

208150

doc/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ If you choose to visualize a body part or a PAF (Part Affinity Field) heat map w
221221
222222
**Q: Low speed** - OpenPose is quite slow, is it normal? How can I speed it up?
223223
224-
**A**: Check the Benchmark to discover the approximate speed of your graphics card: [https://github.com/CMU-Perceptual-Computing-Lab/openpose#openpose-benchmark](https://github.com/CMU-Perceptual-Computing-Lab/openpose#openpose-benchmark). Some speed tips:
224+
**A**: Check the [OpenPose Benchmark](https://docs.google.com/spreadsheets/d/1-DynFGvoScvfWDA1P4jDInCkbD4lg0IKOYbXgEq0sK0/edit#gid=0) to discover the approximate speed of your graphics card. Some speed tips:
225225
226226
1. Use cuDNN 5.1 (cuDNN 6 is ~10% slower).
227-
2. If you have more than 1 GPU, set `--num_gpu`.
228-
3. Reduce the `--net_resolution` (e.g. to 320x176) (lower accuracy).
227+
2. Reduce the `--net_resolution` (e.g. to 320x176) (lower accuracy).
228+
3. For face, reduce the `--face_net_resolution`. The resolution 320x320 usually works pretty decently.
229229
4. Use the `MPI_4_layers` model (lower accuracy and lower number of parts).

doc/output.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
OpenPose Demo - Output
2+
====================================
3+
4+
5+
6+
## Output Format
7+
There are 2 alternatives to save the **(x,y,score) body part locations**. The `write_keypoint` flag uses the OpenCV cv::FileStorage default formats (JSON, XML and YML). However, the JSON format is only available after OpenCV 3.0. Hence, `write_keypoint_json` saves the people pose data using a custom JSON writer. For the latter, each JSON file has a `people` array of objects, where each object has an array `body_parts` containing the body part locations and detection confidence formatted as `x1,y1,c1,x2,y2,c2,...`. The coordinates `x` and `y` can be normalized to the range [0,1], [-1,1], [0, source size], [0, output size], etc., depending on the flag `keypoint_scale`. In addition, `c` is the confidence in the range [0,1].
8+
9+
```
10+
{
11+
"version":0.1,
12+
"people":[
13+
{"body_parts":[1114.15,160.396,0.846207,...]},
14+
{"body_parts":[...]},
15+
]
16+
}
17+
```
18+
19+
The body part order of the COCO (18 body parts) and MPI (15 body parts) keypoints is described in `POSE_BODY_PART_MAPPING` in [include/openpose/pose/poseParameters.hpp](../include/openpose/pose/poseParameters.hpp). E.g., for COCO:
20+
```
21+
POSE_COCO_BODY_PARTS {
22+
{0, "Nose"},
23+
{1, "Neck"},
24+
{2, "RShoulder"},
25+
{3, "RElbow"},
26+
{4, "RWrist"},
27+
{5, "LShoulder"},
28+
{6, "LElbow"},
29+
{7, "LWrist"},
30+
{8, "RHip"},
31+
{9, "RKnee"},
32+
{10, "RAnkle"},
33+
{11, "LHip"},
34+
{12, "LKnee"},
35+
{13, "LAnkle"},
36+
{14, "REye"},
37+
{15, "LEye"},
38+
{16, "REar"},
39+
{17, "LEar"},
40+
{18, "Bkg"},
41+
}
42+
```
43+
44+
For the **heat maps storing format**, instead of individually saving each of the 67 heatmaps (18 body parts + background + 2 x 19 PAFs) individually, the library concatenates them into a huge (width x #heat maps) x (height) matrix, i.e. it concats the heat maps by columns. E.g., columns [0, individual heat map width] contains the first heat map, columns [individual heat map width + 1, 2 * individual heat map width] contains the second heat map, etc. Note that some image viewers are not able to display the resulting images due to the size. However, Chrome and Firefox are able to properly open them.
45+
46+
The saving order is body parts + background + PAFs. Any of them can be disabled with program flags. If background is disabled, then the final image will be body parts + PAFs. The body parts and background follow the order of `POSE_COCO_BODY_PARTS` or `POSE_MPI_BODY_PARTS`, while the PAFs follow the order specified on POSE_BODY_PART_PAIRS in `poseParameters.hpp`. E.g., for COCO:
47+
```
48+
POSE_COCO_PAIRS {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17, 2,16, 5,17};
49+
```
50+
51+
Where each index is the key value corresponding to each body part in `POSE_COCO_BODY_PARTS`, e.g., 0 for "Neck", 1 for "RShoulder", etc.
52+
53+
54+
55+
## Reading Saved Results
56+
We use standard formats (JSON, XML, PNG, JPG, ...) to save our results, so there will be lots of frameworks to read them later, but you might also directly use our functions in [include/openpose/filestream.hpp](../include/openpose/filestream.hpp). In particular, `loadData` (for JSON, XML and YML files) and `loadImage` (for image formats such as PNG or JPG) to load the data into cv::Mat format.
57+
58+
59+
60+
## Pose Output Format
61+
<p align="center">
62+
<img src="media/keypoints_pose.png", width="480">
63+
</p>
64+
65+
66+
67+
## Face Output Format
68+
<p align="center">
69+
<img src="media/keypoints_face.png", width="480">
70+
</p>

0 commit comments

Comments
 (0)