以下内容均来自于OpenPose官方版本的–help结果:
./openpose-master/build/examples/openpose/openpose.bin --help
来自 /build/gflags-YYnfS9/gflags-2.1.2/src/gflags.cc 的标志:
- flagfile:从文件加载flags;类型:字符串;默认值:""
- fromenv:从环境设置flags[使用
export FLAGS_flag1 = value
];类型:字符串;默认值:"" - tryfromenv :如果存在,则从环境中设置标志;类型:字符串;默认值:""
- undefok:即使程序未使用该名称定义标志,也可以在命令行上指定以逗号分隔的标志名称列表。重要说明:此列表中带有参数的标志必须使用flag = value格式;类型: 字符串;默认值:""
来自 /tangshengeng/openpose/include/openpose/flags.hpp 的标志:
- 3d:运行OpenPose 3-D重建演示:
1)从立体摄像机系统读取。
2)从多个视图执行3-D重建。
3)显示3-D重建结果。
请注意,它只会显示1个人。 如果存在多个人,它将失败。
type: bool
default: false - 3d_min_views:重建每个关键点所需的最少视图数。默认情况下为
-1
,将需要 max(2, min(4, #cameras-1)) 个摄像机才能看到关键点以进行重建。)
type: int32
default: -1 - 3d_views:
--image_dir
或--video
的补充选项。 OpenPose每次迭代将读取尽可能多的图像,从而可以执行诸如立体摄像机处理(--3d
)之类的任务。
注意,必须设置--camera_parameter_path
。 OpenPose必须在参数文件夹中找到达到此数字指示的数量的xml
文件。
type: int32
default: -1 - alpha_heatmap:热力图和原始帧之间的混合因子(范围0-1)。
1
仅显示热图,0
仅显示帧。仅对GPU渲染有效。
type: double
default: 0.69999999999999996 - alpha_pose:用于身体部位渲染的混合因子(范围0-1)。·
1
将完全显示,0
将隐藏。仅对GPU渲染有效。
type: double
default: 0.59999999999999998 - body:选择
0
禁用身体关键点检测(例如,用于更快但更不准确的面部关键点检测、自定义手部检测器等);选择1
(默认值)进行身体关键点估计;选择2
以禁用其内部身体姿势估计网络,但仍然运行贪婪关联解析算法
type: int32
default: 1 - caffemodel_path:
--model_folder
+--caffemodel_path
的组合代表了caffemodel文件的完整路径。 如果为空,它将使用默认的OpenPose CaffeModel文件。
type: string
default: “” - camera:视觉采集的摄像机索引,是范围为[0,9]的整数。 默认情况下设定的是一个负数,表示自动检测并打开第一个可用的摄像机。
type: int32
default: -1 - camera_parameter_path:摄像机参数所在文件夹的字符串。 如果只有1个XML文件(来自于相同摄像机的单个视频、网络摄像或图像),则必须指定整个XML文件路径(以
.xml
结尾)。
type: string
default: “models/cameraParameters/flir/” - camera_resolution:设置相机分辨率(
--camera
或--flir_camera
)。-1x-1
将为--camera
使用默认的1280x720
,或为--flir_camera
使用的最大flir相机分辨率。
type: string
default: “-1x-1” - cli_verbose:如果为
-1
,则将其禁用(默认);如果它是一个正整数,它将每verbose
帧在命令行上打印一次日志。 如果数值在(0,1)范围内,它将在每verbose
乘以帧总数时打印日志。
type: double
default: -1 - disable_blending :如果启用,它将在黑色背景上渲染结果(关键点骨架或热图),而不是渲染到原始图像中。 相关:
part_to_show
,alpha_pose
和alpha_pose
。
type: bool
default: false - disable_multi_thread:略微降低帧速率,以大大减少延迟。 主要用于需要低延迟的情况(例如,具有低范围GPU设备的实时场景中的网络摄像头;或者在崩溃时调试OpenPose以查找错误。
type: bool
default: false - display:显示模式。
-1
为自动选择;0
为不显示(在没有X服务器,或不需要视觉输出稍微加快处理速度的情况下是有用的);2
为2D显示;3
为3D显示(在启用--3d
时);1
为2D和3D显示。
type: int32
default: -1 - face:启用面部关键点检测。 它将共享来自身体姿势的一些参数,例如
model_folder
。 请注意,这将大大降低性能并增加所需的GPU内存。 此外,图像上的人数越多,OpenPose的速度就越慢。
type: bool
default: false - face_alpha_heatmap:与
alpha_heatmap
类似,但应用于面部。
type: double
default: 0.69999999999999996 - face_alpha_pose:与
alpha_pose
类似,但应用于面部。
type: double
default: 0.59999999999999998 - face_detector:面部矩形检测器的种类。 选择
0
(默认值)以选择OpenPose人体检测器(如果启用了人体,则是最准确的一种,最快的是一个);选择1以选择OpenCV面部检测器(不适用于手);选择2以指示它将由用户提供;或3 也可以应用手部跟踪(仅用于手部)。 手部跟踪可能会改善网络摄像头(如果帧速率足够高,即每个GPU> 7 FPS)和视频的手部关键点检测。 这不是人员ID跟踪,它只是在前几帧中的手所在的位置中查找手,但不能保证各帧之间的人员ID相同。
type: int32
default: 0 - face_net_resolution 16的倍数和平方。类似于
net_resolution
,但适用于面部关键点检测器。320x320通常可以很好地工作,同时在图像上有多个面部时可以大大提高速度。
type: string
default: “368x368” - face_render:与
render_pose
类似,但应用于面部。 额外的选项:-1
使用与render_pose
相同的配置。
type: int32
default: -1 - face_render_threshold:与
render_threshold
类似,但应用于面部关键点。
type: double
default: 0.40000000000000002 - flir_camera:是否使用FLIR(灰点)立体相机。
type: bool
default: false - flir_camera_index:选择-1(默认)可一次在所有检测到的flir相机上运行。 否则,选择要运行的flir相机索引,其中0对应于检测到的具有最低序列号的flir相机,而
n
对应于第n
个最低序号的相机。
type: int32
default: -1 - fps_max:最大处理帧率。 默认情况下
-1
,OpenPose将尽可能快地处理帧。 用法示例:如果OpenPose显示图像的速度过快,则会降低速度,因此用户可以从GUI更好地分析每一帧。
type: double
default: -1 - frame_first:希望的起始帧号。 索引基于0,即第一帧的索引为0。
type: uint64
default: 0 - frame_flip:对每个帧进行翻转/镜像(例如,用于实时网络摄像头演示)。
type: bool
default: false - frame_last:希望的结束帧号。 选择
-1
以禁用。 索引从0开始,例如,如果设置为10,它将处理11帧(0-10)。
type: uint64
default: 18446744073709551615 - frame_rotate:对每个帧进行旋转,四个可能的值:0、90、180、270。
type: int32
default: 0 - frame_step:要处理的帧之间的步长或间隙。 例如,
-frame_step 5
将读取并处理帧0、5、10等。
type: uint64
default: 1 - frame_undistort:如果为false(默认值),则不会使图像失真;如果为true,则将根据在
camera_parameter_path
中找到的相机参数对图像进行失真处理。
type: bool
default: false - frames_repeat:完成后重复帧。
type: bool
default: false - fullscreen:以全屏模式运行(在运行时按f进行切换)。
type: bool
default: false - hand:启用手部关键点检测。它将共享人体姿势中的一些参数,例如
model_folder
。类似于--face
,它还会降低性能,增加所需的GPU内存,其速度取决于人的数量。
type: bool
default: false - hand_alpha_heatmap:与
alpha_heatmap
类似,但应用于手部。
type: double
default: 0.69999999999999996 - hand_alpha_pose:与
alpha_pose
类似,但应用于手部。
type: double
default: 0.59999999999999998 - hand_detector:一种手部矩形检测器,类似于
--face_detector
。
type: int32
default: 0 - hand_net_resolution:16的倍数和平方。类似于
net_resolution
,但适用于手部关键点检测器。
type: string
default: “368x368” - hand_render:与
render_pose
类似,但应用于手部。 额外的选项:-1
使用与render_pose
相同的配置。
type: int32
default: -1 - hand_render_threshold:与
render_threshold
类似,但应用于手部关键点。
type: double
default: 0.20000000000000001 - hand_scale_number:类似于
scale_number
,但应用于手部关键点检测器。 我们发现最好的结果是hand_scale_number
= 6和hand_scale_range
= 0.4。
type: int32
default: 1 - hand_scale_range:与
scale_gap
类似的目的,但适用于手部关键点检测器。 最小和最大尺度之间的总范围。 尺度将以比率1为中心。例如,如果scaleRange = 0.4且scalesNumber = 2,则将有2个尺度,分别为0.8和1.2。
type: double
default: 0.40000000000000002 - heatmaps_add_PAFs:与
add_heatmaps_parts
具有相同的功能,但增加了PAF。
type: bool
default: false - heatmaps_add_bkg:与
add_heatmaps_parts
相同的功能,但是增加了对应于背景的热力图。
type: bool
default: false - heatmaps_add_parts:如果为true,它将使用身体部位热力图填充
op::Datum::poseHeatMaps
数组,并类似地将面部和手部热力图填充到op::Datum::faceHeatMaps
和op::Datum::handHeatMaps
。 如果启用了多个add_heatmaps_X
标志,那么它将按照顺序存储顺序放置:body parts+ bkg + PAF。 它将遵循src/openpose/pose/poseParameters.cpp
中POSE_BODY_PART_MAPPING上的顺序。 程序速度将大大降低。 OpenPose不需要,只有在以后打算显式使用此信息时才启用它。
type: bool
default: false - heatmaps_scale:设置
0
以在范围[-1,1]中缩放op::Datum::poseHeatMaps
;设置1
则缩放范围为[0,1];2
表示整数舍入[0,255];3
表示无缩放。
type: int32
default: 2 - identification (Experimental, not available yet. Whether to enable people identification across frames.)
type: bool
default: false - ik_threads (Experimental, not available yet. Whether to enable inverse kinematics (IK) from 3-D keypoints to obtain 3-D joint angles. By default (0 threads), it is disabled. Increasing the number of threads will increase the speed but also the global system latency.)
type: int32
default: 0 - image_dir (Process a directory of images. Use
examples/media/
for our default example folder with 20 images. Read all standard formats (jpg, png, bmp, etc.).)
type: string
default: “” - ip_camera (String with the IP camera URL. It supports protocols like RTSP and HTTP.)
type: string
default: “” - keypoint_scale (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_json
&write_keypoint
flags. Select0
to scale it to the original source resolution;1
to scale it to the net output size (set withnet_resolution
);2
to scale it to the final output size (set withresolution
);3
to scale it in the range [0,1], where (0,0) would be the top-left corner of the image, and (1,1) the bottom-right one; and 4 for range [-1,1], where (-1,-1) would be the top-left corner of the image, and (1,1) the bottom-right one. Non related withscale_number
andscale_gap
.)
type: int32
default: 0 - logging_level (The logging level. Integer in the range [0, 255]. 0 will output any opLog() 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.)
type: int32
default: 3 - maximize_positives (It reduces the thresholds to accept a person candidate. It highly increases both false and true positives. I.e., it maximizes average recall but could harm average precision.)
type: bool
default: false - model_folder (Folder path (absolute or relative) where the models (pose, face, …) are located.)
type: string
default: “models/” - model_pose (Model to be used. E.g.,
BODY_25
(fastest for CUDA version, most accurate, and includes foot keypoints),COCO
(18 keypoints),MPI
(15 keypoints, least accurate model but fastest on CPU),MPI_4_layers
(15 keypoints, even faster but less accurate).)
type: string
default: “BODY_25” - net_resolution (Multiples of 16. If it is increased, the accuracy potentially increases. If it is decreased, the speed increases. For maximum speed-accuracy balance, it should keep the closest aspect ratio possible to the images or videos to be processed. Using
-1
in any of the dimensions, OP will choose the optimal aspect ratio depending on the user’s input value. E.g., the default-1x368
is equivalent to656x368
in 16:9 resolutions, e.g., full HD (1980x1080) and HD (1280x720) resolutions.)
type: string
default: “-1x368” - no_gui_verbose (Do not write text on output images on GUI (e.g., number of current frame and people). It does not affect the pose rendering.)
type: bool
default: false - num_gpu (The number of GPU devices to use. If negative, it will use all the available GPUs in your machine.)
type: int32
default: -1 - num_gpu_start (GPU device start number.)
type: int32
default: 0 - number_people_max (This parameter will limit the maximum number of people detected, by keeping the people with top scores. The score is based in person area over the image, body part score, as well as joint score (between each pair of connected body parts). Useful if you know the exact number of people in the scene, so it can remove false positives (if all the people have been detected. However, it might also include false negatives by removing very small or highly occluded people. -1 will keep them all.)
type: int32
default: -1 - output_resolution (The image resolution (display and output). Use “-1x-1” to force the program to use the input image resolution.)
type: string
default: “-1x-1” - part_candidates (Also enable
write_json
in order to save this information. If true, it will fill the op::Datum::poseCandidates array with the body part candidates. Candidates refer to all the detected body parts, before being assembled into people. Note that the number of candidates is equal or higher than the number of final body parts (i.e., after being assembled into people). The empty body parts are filled with 0s. Program speed will slightly decrease. Not required for OpenPose, enable it only if you intend to explicitly use this information.)
type: bool
default: false - part_to_show (Prediction channel to visualize: 0 (default) for all the body parts, 1 for the background heat map, 2 for the superposition of heatmaps, 3 for the superposition of PAFs, 4-(4+#keypoints) for each body part heat map, the following ones for each body part pair PAF.)
type: int32
default: 0 - process_real_time (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.)
type: bool
default: false - profile_speed (If PROFILER_ENABLED was set in CMake or Makefile.config files, OpenPose will show some runtime statistics at this frame number.)
type: int32
default: 1000 - prototxt_path (The combination
--model_folder
+--prototxt_path
represents the whole path to the prototxt file. If empty, it will use the default OpenPose ProtoTxt file.)
type: string
default: “” - render_pose (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 -1, it will pick CPU if CPU_ONLY is enabled, or GPU if CUDA is enabled. If rendering is enabled, it will render bothoutputData
andcvOutputData
with the original image and desired body part to be shown (i.e., keypoints, heat maps or PAFs).)
type: int32
default: -1 - render_threshold (Only estimated keypoints whose score confidences are higher than this threshold will be rendered. Note: Rendered refers only to visual display in the OpenPose basic GUI, not in the saved results. 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).)
type: double
default: 0.050000000000000003 - scale_gap (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.)
type: double
default: 0.25 - scale_number (Number of scales to average.)
type: int32
default: 1 - tracking (Experimental, not available yet. Whether to enable people tracking across frames. The value indicates the number of frames where tracking is run between each OpenPose keypoint detection. Select -1 (default) to disable it or 0 to run simultaneously OpenPose keypoint detector and tracking for potentially higher accurary than only OpenPose.)
type: int32
default: -1 - udp_host (Experimental, not available yet. IP for UDP communication. E.g.,
192.168.0.1
.)
type: string
default: “” - udp_port (Experimental, not available yet. Port number for UDP communication.)
type: string
default: “8051” - upsampling_ratio (Upsampling ratio between the
net_resolution
and the output net results. A value less or equal than 0 (default) will use the network default value (recommended).)
type: double
default: 0 - video (Use a video file instead of the camera. Use
examples/media/video.avi
for our default example video.)
type: string
default: “” - write_bvh (Experimental, not available yet. E.g.,
~/Desktop/mocapResult.bvh
.)
type: string
default: “” - write_coco_json (Full file path to write people pose data with JSON COCO validation format. If foot, face, hands, etc. JSON is also desired (
--write_coco_json_variants
), they are saved with different file name suffix.)
type: string
default: “” - write_coco_json_variant (Currently, this option is experimental and only makes effect on car JSON generation. It selects the COCO variant for cocoJsonSaver.)
type: int32
default: 0 - write_coco_json_variants (Add 1 for body, add 2 for foot, 4 for face, and/or 8 for hands. Use 0 to use all the possible candidates. E.g., 7 would mean body+foot+face COCO JSON.)
type: int32
default: 1 - write_heatmaps (Directory to write body pose heatmaps in PNG format. At least 1
add_heatmaps_X
flag must be enabled.)
type: string
default: “” - write_heatmaps_format (File extension and format for
write_heatmaps
, analogous towrite_images_format
. For lossless compression, recommendedpng
for integerheatmaps_scale
andfloat
for floating values. Seedoc/output.md
for more details.)
type: string
default: “png” - write_images (Directory to write rendered frames in
write_images_format
image format.)
type: string
default: “” - write_images_format (File extension and format for
write_images
, e.g., png, jpg or bmp. Check the OpenCV function cv::imwrite for all compatible extensions.)
type: string
default: “png” - write_json (Directory to write OpenPose output in JSON format. It includes body, hand, and face pose keypoints (2-D and 3-D), as well as pose candidates (if
--part_candidates
enabled).)
type: string
default: “” - write_keypoint ((Deprecated, use
write_json
) Directory to write the people pose keypoint data. Set format withwrite_keypoint_format
.)
type: string
default: “” - write_keypoint_format ((Deprecated, use
write_json
) File extension and format forwrite_keypoint
: json, xml, yaml & yml. Json not available for OpenCV < 3.0, usewrite_json
instead.)
type: string
default: “yml” - write_video (Full file path to write rendered frames in motion JPEG video format. It might fail if the final path does not finish in
.avi
. It internally uses cv::VideoWriter. Flagwrite_video_fps
controls FPS. Alternatively, the video extension can be.mp4
, resulting in a file with a much smaller size and allowing--write_video_with_audio
. However, that would require: 1) Ubuntu or Mac system, 2) FFmpeg library installed (sudo apt-get install ffmpeg
), 3) the creation temporarily of a folder with the same file path than the final video (without the extension) to storage the intermediate frames that will later be used to generate the final MP4 video.)
type: string
default: “” - write_video_3d (Analogous to
--write_video
, but applied to the 3D output.)
type: string
default: “” - write_video_adam (Experimental, not available yet. Analogous to
--write_video
, but applied to Adam model.)
type: string
default: “” - write_video_fps (Frame rate for the recorded video. By default, it will try to get the input frames producer frame rate (e.g., input video or webcam frame rate). If the input frames producer does not have a set FPS (e.g., image_dir or webcam if OpenCV not compiled with its support), set this value accordingly (e.g., to the frame rate displayed by the OpenPose GUI).)
type: double
default: -1 - write_video_with_audio (If the input is video and the output is so too, it will save the video with audio. It requires the output video file path finishing in
.mp4
format (seewrite_video
for details).)
type: bool
default: false