quick_start.md 6.2 KB
Newer Older
1 2 3 4 5 6 7 8
OpenPose - Quick Start
====================================

## Contents
1. [Quick Start](#quick-start)
    1. [Running on Video](#running-on-video)
    2. [Running on Webcam](#running-on-webcam)
    3. [Running on Images](#running-on-images)
9
    4. [Maximum Accuracy Configuration](#maximum-accuracy-configuration)
G
gineshidalgo99 已提交
10
    5. [3-D Reconstruction](#3-d-reconstruction)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
2. [Expected Visual Results](#expected-visual-results)



## Quick Start
Check that the library is working properly by running any of the following commands. Make sure that you are in the **root directory of the project** (i.e. in the OpenPose folder, not inside `build/` nor `windows/` nor `bin/`). In addition, `examples/media/video.avi` and `examples/media` do exist, no need to change the paths.

### Running on Video
```
# Ubuntu
./build/examples/openpose/openpose.bin --video examples/media/video.avi
# With face and hands
./build/examples/openpose/openpose.bin --video examples/media/video.avi --face --hand
```
```
G
gineshidalgo99 已提交
26
:: Windows - Portable Demo
27 28 29 30 31 32
bin\OpenPoseDemo.exe --video examples\media\video.avi
:: With face and hands
bin\OpenPoseDemo.exe --video examples\media\video.avi --face --hand
```
```
:: Windows - Library
33
build\x64\Release\OpenPoseDemo.exe --video examples\media\video.avi
34
:: With face and hands
35
build\x64\Release\OpenPoseDemo.exe --video examples\media\video.avi --face --hand
36 37 38 39 40 41 42 43 44 45 46 47
```



### Running on Webcam
```
# Ubuntu
./build/examples/openpose/openpose.bin
# With face and hands
./build/examples/openpose/openpose.bin --face --hand
```
```
G
gineshidalgo99 已提交
48
:: Windows - Portable Demo
49 50 51 52 53 54
bin\OpenPoseDemo.exe
:: With face and hands
bin\OpenPoseDemo.exe --face --hand
```
```
:: Windows - Library
55
build\x64\Release\OpenPoseDemo.exe
56
:: With face and hands
57
build\x64\Release\OpenPoseDemo.exe --face --hand
58 59 60 61 62 63 64 65 66 67 68 69
```



### Running on Images
```
# Ubuntu
./build/examples/openpose/openpose.bin --image_dir examples/media/
# With face and hands
./build/examples/openpose/openpose.bin --image_dir examples/media/ --face --hand
```
```
G
gineshidalgo99 已提交
70
:: Windows - Portable Demo
71 72 73 74 75 76
bin\OpenPoseDemo.exe --image_dir examples\media\
:: With face and hands
bin\OpenPoseDemo.exe --image_dir examples\media\ --face --hand
```
```
:: Windows - Library
77
build\x64\Release\OpenPoseDemo.exe --image_dir examples\media\
78
:: With face and hands
79
build\x64\Release\OpenPoseDemo.exe --image_dir examples\media\ --face --hand
80 81 82 83 84
```



### Maximum Accuracy Configuration
G
gineshidalgo99 已提交
85
This command provides the most accurate results we have been able to achieve for body, hand and face keypoint detection. However, this command will need around 6.7 GB of GPU memory and runs around 1 FPS on a Titan X for body.
86
```
G
gineshidalgo99 已提交
87 88 89
# Ubuntu: Body
./build/examples/openpose/openpose.bin --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25
# Ubuntu: Body + Hand + Face
90 91 92
./build/examples/openpose/openpose.bin --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25 --hand --hand_scale_number 6 --hand_scale_range 0.4 --face
```
```
G
gineshidalgo99 已提交
93
:: Windows - Portable Demo: Body
G
gineshidalgo99 已提交
94
bin\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25
G
gineshidalgo99 已提交
95
:: Windows - Portable Demo: Body + Hand + Face
96 97 98
bin\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25 --hand --hand_scale_number 6 --hand_scale_range 0.4 --face
```
```
G
gineshidalgo99 已提交
99
:: Windows - Library: Body
100
build\x64\Release\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25
G
gineshidalgo99 已提交
101
:: Windows - Library: Body + Hand + Face
102
build\x64\Release\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25 --hand --hand_scale_number 6 --hand_scale_range 0.4 --face
103 104 105 106
```



G
gineshidalgo99 已提交
107
### 3-D Reconstruction
108
1. Real-time demo
G
gineshidalgo99 已提交
109 110
```
# Ubuntu
111
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1
G
gineshidalgo99 已提交
112
# With face and hands
113
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --face --hand
G
gineshidalgo99 已提交
114 115 116
```
```
:: Windows - Portable Demo
117
bin\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1
G
gineshidalgo99 已提交
118
:: With face and hands
119
bin\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1 --face --hand
G
gineshidalgo99 已提交
120 121 122
```
```
:: Windows - Library
123
build\x64\Release\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1
G
gineshidalgo99 已提交
124
:: With face and hands
125
build\x64\Release\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1 --face --hand
G
gineshidalgo99 已提交
126 127
```

128
2. Saving 3-D keypoints
129 130
```
# Ubuntu (same flags for Windows version)
131
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --write_json output_folder_path/
132 133
```

134
3. Fast stereo camera image saving (without keypoint detection) for later post-processing
135 136
```
# Ubuntu (same flags for Windows version)
137 138 139 140
# Saving video
# Note: saving in PNG rather than JPG will improve image quality, but slow down FPS (depending on hard disk writing speed and camera number)
./build/examples/openpose/openpose.bin --flir_camera --num_gpu 0 --write_video output_folder_path/video.avi
# Saving images
141
# Note: saving in PNG rather than JPG will improve image quality, but slow down FPS (depending on hard disk writing speed and camera number)
G
gineshidalgo99 已提交
142
./build/examples/openpose/openpose.bin --flir_camera --num_gpu 0 --write_images output_folder_path/ --write_images_format jpg
143 144 145
```

4. Reading and processing previouly saved stereo camera images
146 147
```
# Ubuntu (same flags for Windows version)
148
# Optionally add `--face` and/or `--hand` to include face and/or hands
149
# Assuming 3 cameras
150 151 152 153 154
# Note: We highly recommend to reduce `--output_resolution`. E.g. for 3 cameras recording at 1920x1080, the resulting image is (3x1920)x1080, so we recommend e.g. 1920x360 (x3 reduction).
# Video
./build/examples/openpose/openpose.bin --video output_folder_path/video.avi --3d_views 3 --3d --number_people_max 1 --output_resolution {desired_output_resolution}
# Images
./build/examples/openpose/openpose.bin --image_dir output_folder_path/ --3d_views 3 --3d --number_people_max 1 --output_resolution {desired_output_resolution}
155 156
```

G
gineshidalgo99 已提交
157 158


159 160 161 162 163 164 165 166 167 168 169 170 171 172
## Expected Visual Results
The visual GUI should show the original image with the poses blended on it, similarly to the pose of this gif:
<p align="center">
    <img src="media/shake.gif", width="720">
</p>

If you choose to visualize a body part or a PAF (Part Affinity Field) heat map with the command option `--part_to_show`, the result should be similar to one of the following images:
<p align="center">
    <img src="media/body_heat_maps.png", width="720">
</p>

<p align="center">
    <img src="media/paf_heat_maps.png", width="720">
</p>