原文:Github 项目 - OpenPose 参数说明 - AIUAI
OpenPose 作为强大的关键点估计项目,其提供了很多可配置参数选项.
完整参数列表可运行:
# buntu
cd OPENPOSE_ROOT/
./build/examples/openpose/openpose.bin --help
OpenPose 运行,如:
# Ubuntu: Body + Hand + Face
./build/examples/openpose/openpose.bin
-image_dir /path/to/images/
--num_gpu_start 1
--display 2
--fullscreen
--write_images /path/to/res_images/
--net_resolution "1312x736"
--scale_number 4
--scale_gap 0.25
--hand
--hand_scale_number 6
--hand_scale_range 0.4
--face
# Ubuntu: Body
./build/examples/openpose/openpose.bin
--image_dir /path/to/images/
--num_gpu_start 1
--display 2
--fullscreen
--write_images /path/to/res_images/
1. 部分关键参数
-
--face
: 开启 Face 关键点检测. -
--hand
: 开启 Hand 关键点检测 -
--video input.mp4
: 读取 Video. -
--camera 3
: 读取 webcam number 3. -
--image_dir path_to_images/
: 运行图像路径内的图片. -
--ip_camera http://iris.not.iac.es/axis-cgi/mjpg/video.cgi?resolution=320x240?x.mjpeg
: 在 streamed IP camera 上运行. 参考public IP cameras 例子. -
--write_video path.avi
: 将处理后的图片保存为 Video. -
--write_images folder_path
: 将处理后的图片保存到指定路径. -
--write_keypoint path/
: 在指定路径输出包含人体姿态数据的 JSON, XML 或 YML 文件. -
--process_real_time
: 对于视频,可能在实时运行时,跳过某些视频帧. -
--disable_blending
: 如果--disable_blending=True
,则在很色背景上渲染估计结果(如 keypoints skeletons 和 heatmaps),而不显示原始图像. Related:part_to_show
,alpha_pose
, andalpha_pose
. -
--part_to_show
: 可视化的预测通道(Prediction channel). -
--display 0
: 不打开可视化显示窗口. 对于服务器部署和 OpenPose 加速很帮助. -
--num_gpu 2 --num_gpu_start 1
: 多 GPUs 时,设置开始的 GPU id. 默认使用所有可用的 GPUs. -
--model_pose MPI
: 采用的模型Model,影响 Keypoints 的数量、运行速度和精度. -
--logging_level 3
: Logging messages threshold, range [0,255]: 0 - 输出所有信息e & 255 - 不输出任何信息. Current messages in the range [1-4], 1 for low priority messages and 4 for important ones.
2. 参数说明
每个 Flag 包括 flag_name
, default value
和 description
.
2.1 Debugging/Other
- 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_bool(disable_multi_thread, false, “It would slightly reduce the frame rate in order to highly reduce the lag. Mainly useful for 1) Cases where it is needed a low latency (e.g., webcam in real-time scenarios with low-range GPU devices); and 2) Debugging OpenPose when it is crashing to locate the error.”); 多线程
- DEFINE_int32(profile_speed, 1000, “If PROFILER_ENABLED was set in CMake or Makefile.config files, OpenPose will show some runtime statistics at this frame number.”);
2.2 Producer
- DEFINE_int32(camera, -1, “The camera index for cv::VideoCapture. Integer in the range [0, 9]. Select a negative number (by default), to auto-detect and open the first available camera.”); 相机作为输入
- DEFINE_string(camera_resolution, “-1x-1”, "Set the camera resolution (either
--camera
or--flir_camera
).-1x-1
will use the default 1280x720 for--camera
, or the maximum flir camera resolution available for--flir_camera
"); 相机分辨率 - DEFINE_string(video, “”, “Use a video file instead of the camera. Use
examples/media/video.avi
for our default example video.”); Video 作为输入,而不采用相机 - DEFINE_string(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.).”); 待处理图像的路径 - DEFINE_bool(flir_camera, false, “Whether to use FLIR (Point-Grey) stereo camera