提交 72a1f5f6 编写于 作者: G gineshidalgo99

GPU render by default + doc updated

上级 c26ea6d4
......@@ -13,6 +13,7 @@ Issues/comments that do not follow this will be **ignored or removed** with no f
### Executed command (if any)
Note: add `--logging_level 0` to get higher debug information.
......
......@@ -11,7 +11,7 @@ In order to learn how to use it, run `./build/examples/openpose/openpose.bin --h
Each flag is divided into flag name, default value, and description.
1. Debugging
- DEFINE_int32(logging_level, 3, "The logging level. Integer in the range [0, 255]. 0 will output any log() message, while 255 will not output any. Current OpenPose library messages are in the range 0-4: 1 for low priority messages and 4 for important ones.");
- DEFINE_int32(logging_level, 4, "The logging level. Integer in the range [0, 255]. 0 will output any log() message, while 255 will not output any. Current OpenPose library messages are in the range 0-4: 1 for low priority messages and 4 for important ones.");
2. Producer
- DEFINE_int32(camera, 0, "The camera index for cv::VideoCapture. Integer in the range [0, 9].");
- DEFINE_string(camera_resolution, "1280x720", "Size of the camera frames to ask for.");
......@@ -42,12 +42,13 @@ Each flag is divided into flag name, default value, and description.
- 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.");
6. OpenPose Hand
- DEFINE_bool(hand, false, "Enables hand keypoint detection. It will share some parameters from the body pose, e.g. `model_folder`.");
- 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.");
- 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.");
- 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).");
7. OpenPose Rendering
- DEFINE_int32(part_to_show, 0, "Part to show from the start.");
- 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.");
8. OpenPose Rendering Pose
- DEFINE_int32(render_pose, 1, "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).");
- 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).");
- 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.");
- 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.");
9. OpenPose Rendering Face
......@@ -109,15 +110,63 @@ Please, in order to check all the real time pose demo options and their details,
## Hands
Very important note, use `hand_detection_mode` accordingly.
```
# Images
# Fast method for speed
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 0
# Iterative for higher accuracy
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 1
# Video
# Iterative tracking for higher accuracy
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_detection_mode 3
# Tracking for speed
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_detection_mode 2
# Webcam
# Fast method for speed if the frame rate is low
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 0
# Iterative for higher accuracy (but the frame rate will be reduced)
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 1
# Tracking for higher accuracy if the frame rate is high enough. Worse results than fast method if frame rate is low
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 2
# Iterative + tracking for best accuracy if frame rate is high enough. Worse results than fast method if frame rate is low
./build/examples/openpose/openpose.bin --hand --hand_detection_mode 3
```
## Debugging Information
```
# Basic information
./build/examples/openpose/openpose.bin --logging_level 3
# Showing all messages
./build/examples/openpose/openpose.bin --logging_level 0
```
## Pose + Face + Hands
```
./build/examples/openpose/openpose.bin --face --hand
```
## Rendering Face without Pose
```
# CPU rendering (faster)
./build/examples/openpose/openpose.bin --face --render_pose 0 --render_face 1
# GPU rendering
./build/examples/openpose/openpose.bin --face --render_pose 0 --render_face 2
```
## Example
The following example runs the demo video `video.avi`, renders image frames on `output/result.avi`, and outputs JSON files in `output/`. It parallelizes over 2 GPUs, GPUs 1 and 2. Note that it will skip GPU 0:
## Basic Output Saving
The following example runs the demo video `video.avi`, renders image frames on `output/result.avi`, and outputs JSON files in `output/`. It parallelizes over 2 GPUs, GPUs 1 and 2 (note that it will skip GPU 0):
```
./build/examples/openpose/openpose.bin --video examples/media/video.avi --num_gpu 2 --num_gpu_start 1 --write_video output/result.avi --write_keypoint_json output/
```
......@@ -227,3 +227,4 @@ If you choose to visualize a body part or a PAF (Part Affinity Field) heat map w
2. Reduce the `--net_resolution` (e.g. to 320x176) (lower accuracy).
3. For face, reduce the `--face_net_resolution`. The resolution 320x320 usually works pretty decently.
4. Use the `MPI_4_layers` model (lower accuracy and lower number of parts).
5. Change GPU rendering by CPU rendering to get approximately +0.5 FPS (`--render_pose 1`).
因为 它太大了无法显示 image diff 。你可以改为 查看blob
因为 它太大了无法显示 image diff 。你可以改为 查看blob
......@@ -4,14 +4,14 @@ OpenPose Demo - Output
## Output Format
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].
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 `pose_keypoints` 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].
```
{
"version":0.1,
"people":[
{"body_parts":[1114.15,160.396,0.846207,...]},
{"body_parts":[...]},
{"pose_keypoints":[1114.15,160.396,0.846207,...]},
{"pose_keypoints":[...]},
]
}
```
......@@ -50,6 +50,9 @@ The saving order is body parts + background + PAFs. Any of them can be disabled
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.
### Face and Hands
The output format is analogous for hand (`hand_left_keypoints` and `hand_right_keypoints`) and face (`face_keypoints`) JSON files.
## Reading Saved Results
......
......@@ -114,7 +114,7 @@ DEFINE_int32(part_to_show, 0, "Part to show from the s
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.");
// OpenPose Rendering Pose
DEFINE_int32(render_pose, 1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
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).");
......@@ -215,7 +215,7 @@ op::ProducerType gflagsToProducerType(const std::string& imageDirectory, const s
}
std::shared_ptr<op::Producer> gflagsToProducer(const std::string& imageDirectory, const std::string& videoPath, const int webcamIndex,
const op::Point<int> webcamResolution, const int webcamFps)
const op::Point<int> webcamResolution, const double webcamFps)
{
op::log("", op::Priority::Low, __LINE__, __FUNCTION__, __FILE__);
const auto type = gflagsToProducerType(imageDirectory, videoPath, webcamIndex);
......
......@@ -101,7 +101,7 @@ DEFINE_int32(part_to_show, 0, "Part to show from the s
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.");
// OpenPose Rendering Pose
DEFINE_int32(render_pose, 1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
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).");
......
......@@ -101,7 +101,7 @@ DEFINE_int32(part_to_show, 0, "Part to show from the s
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.");
// OpenPose Rendering Pose
DEFINE_int32(render_pose, 1, "Set to 0 for no rendering, 1 for CPU rendering (slightly faster), and 2 for GPU rendering"
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).");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册