Are you sure you want to delete this access key?
Forget about the OpenPose library code, just compile the library and use the demo ./build/examples/openpose/openpose.bin
.
In order to learn how to use it, run ./build/examples/openpose/openpose.bin --help
in your bash and read all the available flags (check only the flags for examples/openpose/openpose.cpp
itself, i.e. the section Flags from examples/openpose/openpose.cpp:
). We detail some of them in the following sections.
See doc/quick_start.md#quick-start.
See doc/quick_start.md#quick-start.
See doc/quick_start.md#quick-start.
Since the Windows 10 Anniversary, Kinect 2.0 can be read as a normal webcam. All you need to do is go to device manager
, expand the kinect sensor devices
tab, right click and update driver of WDF kinectSensor Interface
. If you already have another webcam, disconnect it or use --camera 2
.
The following example runs the demo video video.avi
and outputs JSON files in output/
. Note: see doc/output.md to understand the format of the JSON files.
# Only body
./build/examples/openpose/openpose.bin --video examples/media/video.avi --write_keypoint_json output/ --no_display --render_pose 0
# Body + face + hands
./build/examples/openpose/openpose.bin --video examples/media/video.avi --write_keypoint_json output/ --no_display --render_pose 0 --face --hand
The following example runs the demo video video.avi
, renders image frames on output/result.avi
, and outputs JSON files in output/
. Note: see doc/output.md to understand the format of the JSON files.
./build/examples/openpose/openpose.bin --video examples/media/video.avi --write_video output/result.avi --write_keypoint_json output/
# Fast method for speed
./build/examples/openpose/openpose.bin --hand
# Best results found with 6 scales
./build/examples/openpose/openpose.bin --hand --hand_scale_number 6 --hand_scale_range 0.4
# Adding tracking to Webcam (if FPS per GPU > 10 FPS) and Video
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_tracking
# Multi-scale + tracking is also possible
./build/examples/openpose/openpose.bin --video examples/media/video.avi --hand --hand_scale_number 6 --hand_scale_range 0.4 --hand_tracking
# CPU rendering (faster)
./build/examples/openpose/openpose.bin --render_pose 0 --face --face_render 1 --hand --hand_render 1
# GPU rendering
./build/examples/openpose/openpose.bin --render_pose 0 --face --face_render 2 --hand --hand_render 2
# Basic information
./build/examples/openpose/openpose.bin --logging_level 3
# Showing all messages
./build/examples/openpose/openpose.bin --logging_level 0
The following example runs the demo video video.avi
, parallelizes it 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
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.
./build/examples/openpose/openpose.bin --video examples/media/video.avi --heatmaps_add_parts --heatmaps_add_bkg --heatmaps_add_PAFs --write_heatmaps output_heatmaps_folder/
We enumerate some of the most important flags, check the Flags Detailed Description
section or run ./build/examples/openpose/openpose.bin --help
for a full description of all of them.
--face
: Enables face keypoint detection.--hand
: Enables hand keypoint detection.--video input.mp4
: Read video.--camera 3
: Read webcam number 3.--image_dir path_to_images/
: Run on a folder with images.--ip_camera http://iris.not.iac.es/axis-cgi/mjpg/video.cgi?resolution=320x240?x.mjpeg
: Run on a streamed IP camera. See examples public IP cameras here.--write_video path.avi
: Save processed images as video.--write_images folder_path
: Save processed images on a folder.--write_keypoint path/
: Output JSON, XML or YML files with the people pose data on a folder.--process_real_time
: For video, it might skip frames to display at real time.--disable_blending
: If enabled, it will render the results (keypoint skeletons or heatmaps) on a black background, not showing the original image. Related: part_to_show
, alpha_pose
, and alpha_pose
.--part_to_show
: Prediction channel to visualize.--no_display
: Display window not opened. Useful for servers and/or to slightly speed up OpenPose.--num_gpu 2 --num_gpu_start 1
: Parallelize over this number of GPUs starting by the desired device id. By default it uses all the available GPUs.--model_pose MPI
: Model to use, affects number keypoints, speed and accuracy.--logging_level 3
: Logging messages threshold, range [0,255]: 0 will output any message & 255 will output none. Current messages in the range [1-4], 1 for low priority messages and 4 for important ones.Each flag is divided into flag name, default value, and description.
examples/media/video.avi
for our default example video.");examples/media/
for our default example folder with 20 images. Read all standard formats (jpg, png, bmp, etc.).");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
.");COCO
(18 keypoints), MPI
(15 keypoints, ~10% faster), MPI_4_layers
(15 keypoints, even faster but less accurate).");-1
in any of the dimensions, OP will choose the optimal resolution depending on the other value introduced by the user. E.g. the default -1x368
is equivalent to 656x368
in 16:9 videos, e.g. full HD (1980x1080) and HD (1280x720) resolutions.");net_resolution
by your desired initial scale.");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
.");add_heatmaps_parts
, but adding the heatmap corresponding to background.");add_heatmaps_parts
, but adding the PAFs.");model_folder
. Note that this will considerable slow down the performance and increse the required GPU memory. In addition, the greater number of people on the image, the slower OpenPose will be.");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.");model_folder
. Analogously to --face
, it will also slow down the performance, increase the required GPU memory and its speed depends on the number of people.");net_resolution
but applied to the hand keypoint detector.");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");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.");part_to_show
, alpha_pose
, and alpha_pose
.");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).");render_threshold
, but applied to the face keypoints.");render_pose
but applied to the face. Extra option: -1 to use the same configuration that render_pose
is using.");alpha_pose
but applied to face.");alpha_heatmap
but applied to face.");render_threshold
, but applied to the hand keypoints.");render_pose
but applied to the hand. Extra option: -1 to use the same configuration that render_pose
is using.");alpha_pose
but applied to hand.");alpha_heatmap
but applied to hand.");write_images_format
image format.");write_images
, e.g. png, jpg or bmp. Check the OpenCV function cv::imwrite for all compatible extensions.");.avi
. It internally uses cv::VideoWriter.");write_keypoint_format
.");write_keypoint
: json, xml, yaml & yml. Json not available for OpenCV < 3.0, use write_keypoint_json
instead.");add_heatmaps_X
flag must be enabled.");write_heatmaps
, analogous to write_images_format
. Recommended png
or any compressed and lossless format.");Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?