[openpose]openpose常用终端命令

OpenPose - Quick Start

Contents

  1. Quick Start
    1. BODY_25 vs. COCO vs. MPI Models
    2. Running on Video
    3. Running on Webcam
    4. Running on Images
    5. Maximum Accuracy Configuration
    6. 3-D Reconstruction
    7. Tracking
  2. Expected Visual Results

快速开始

通过在任何命令行界面程序上运行以下任何命令,检查库是否正常工作。在Ubuntu、Mac和其他Unix系统中,使用任何命令行界面,如“终端”或“终结者”。在Windows中,打开“PowerShell”(推荐)或Windows命令提示符(CMD)。它们可以通过按Windows按钮+X打开,然后按A.如果您不熟悉这些非GUI工具,请随时观看任何Youtube视频教程。确保您位于项目根目录中(即OpenPose文件夹中,不在“build/”、“windows/”或“bin/”内)。此外,“examples/media/video.avi”和“examples/media”确实存在,无需更改路径。

BODY_25 vs. COCO vs. MPI 模型

BODY_25模型(--model_pose BODY_25)包括身体和脚部关键点,并且它基于OpenPose:使用部分亲和字段的实时多人2D姿势估计. COCO和MPI模型速度较慢,精度较低,并且不包含脚部关键点。它们基于我们的旧论文使用部分亲和字段的实时多人2D姿势估计. 强烈建议仅使用BODY_25型号。

有一个例外,对于CPU版本,COCO和MPI模型似乎更快。BODY_25模型的精度仍然更好。

视频推理

# Ubuntu and Mac
./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
:: Windows - Portable Demo
bin\OpenPoseDemo.exe --video examples\media\video.avi
:: With face and hands
bin\OpenPoseDemo.exe --video examples\media\video.avi --face --hand
:: Windows - Library - Assuming you copied the DLLs following doc/installation.md#windows
build\x64\Release\OpenPoseDemo.exe --video examples\media\video.avi
:: With face and hands
build\x64\Release\OpenPoseDemo.exe --video examples\media\video.avi --face --hand

摄像头推理

# Ubuntu and Mac
./build/examples/openpose/openpose.bin
# With face and hands
./build/examples/openpose/openpose.bin --face --hand
:: Windows - Portable Demo
bin\OpenPoseDemo.exe
:: With face and hands
bin\OpenPoseDemo.exe --face --hand
:: Windows - Library - Assuming you copied the DLLs following doc/installation.md#windows
build\x64\Release\OpenPoseDemo.exe
:: With face and hands
build\x64\Release\OpenPoseDemo.exe --face --hand

图像推理

# Ubuntu and Mac
./build/examples/openpose/openpose.bin --image_dir examples/media/
# With face and hands
./build/examples/openpose/openpose.bin --image_dir examples/media/ --face --hand
:: Windows - Portable Demo
bin\OpenPoseDemo.exe --image_dir examples\media\
:: With face and hands
bin\OpenPoseDemo.exe --image_dir examples\media\ --face --hand
:: Windows - Library - Assuming you copied the DLLs following doc/installation.md#windows
build\x64\Release\OpenPoseDemo.exe --image_dir examples\media\
:: With face and hands
build\x64\Release\OpenPoseDemo.exe --image_dir examples\media\ --face --hand

最高精度配置

该命令提供了我们能够实现的最准确的身体、手和面部关键点检测结果。

然而

-考虑到所需的大量内存,这将无法在CPU上工作。对于仅使用CPU的版本,您唯一的选择是手动裁剪人员,以适应输入OpenPose的图像的整个区域。

-对于body foot(body_25)型号,它还需要约10.5 GB的GPU内存(对于COCO型号,约6.7 GB)。

-这需要像Titan X、Titan XP、一些Quadro型号、P100、V100等GPU。

-包括手和脸在内,将需要>=16GB的GPU(因此像Titan X和XP这样的12GB GPU将不再工作)。

-对于体足模型,此命令在Titan X上以约2 FPS的速度运行(对于COCO,约1 FPS)。

-增加“–net_resolution”将大大降低帧速率并增加延迟,同时可能会提高准确性。然而,这种准确性的提高并不是在所有场景中都能保证的,需要对每个特定场景进行更详细的分析。例如,它对非常小的人的图像效果更好,但对拍摄大比例图像的人来说通常更差。因此,我们建议在大多数情况下,对于体型较大和体型较小的人,遵循以下命令以获得最大的准确性。

-请勿将此配置用于MPII模型,此多尺度设置可能会损害其准确性。此配置仅适用于COCO和COCO扩展(例如,默认BODY_25)型号。

方法预览:

# Ubuntu and Mac: Body
./build/examples/openpose/openpose.bin --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25
# Ubuntu and Mac: Body + Hand + Face
./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
:: Windows - Portable Demo: Body
bin\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25
:: Windows - Portable Demo: Body + Hand + Face
bin\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25 --hand --hand_scale_number 6 --hand_scale_range 0.4 --face
:: Windows - Library - Assuming you copied the DLLs following doc/installation.md#windows: Body
build\x64\Release\OpenPoseDemo.exe --net_resolution "1312x736" --scale_number 4 --scale_gap 0.25
:: Windows - Library - Assuming you copied the DLLs following doc/installation.md#windows: Body + Hand + Face
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

If you want to increase the accuracy value metric on COCO, while harming the qualitative accuracy, add the flag --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. Our experience is that it looks much worse visually, but it improves the COCO accuracy numbers, so use it at your own risk.

In addition, our paper numbers are not based on the current models that have been released. We released our best model at the time but later found a better one. But given that the accuracy difference is less than 2%, we did not want to release yet another model to avoid confusion for the users (otherwise there would be more than 10 models released at this point). We will release a new one every time a major improvement is achieved.

If you are operating on Ubuntu, you can check the experimental scripts that we use to test our accuracy (we do not officially support it, i.e., we will not answer questions about it, as well as it might change it continuously), they are placed in openpose/scripts/tests/, called pose_accuracy_coco_test_dev.sh and pose_accuracy_coco_val.sh.

3-D 重建

  1. Real-time demo
# Ubuntu and Mac
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1
# With face and hands
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --face --hand
:: Windows - Portable Demo
bin\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1
:: With face and hands
bin\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1 --face --hand
:: Windows - Library - Assuming you copied the DLLs following doc/installation.md#windows
build\x64\Release\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1
:: With face and hands
build\x64\Release\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1 --face --hand
  1. Saving 3-D keypoints and video
# Ubuntu and Mac (same flags for Windows version)
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --write_json output_folder_path/ --write_video_3d output_folder_path/video_3d.avi
  1. Fast stereo camera image saving (without keypoint detection) for later post-processing
# Ubuntu and Mac (same flags for Windows version)
# 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 --write_video_fps 5
# Saving images
# 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_images output_folder_path/ --write_images_format jpg
  1. Reading and processing previouly saved stereo camera images
# Ubuntu and Mac (same flags for Windows version)
# Optionally add `--face` and/or `--hand` to include face and/or hands
# Assuming 3 cameras
# 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. 640x360 (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}
  1. Reconstruction when the keypoint is visible in at least x camera views out of the total n cameras
# Ubuntu and Mac (same flags for Windows version)
# Reconstruction when a keypoint is visible in at least 2 camera views (assuming `n` >= 2)
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --3d_min_views 2 --output_resolution {desired_output_resolution}
# Reconstruction when a keypoint is visible in at least max(2, min(4, n-1)) camera views
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --output_resolution {desired_output_resolution}

追踪

  1. Runtime huge speed up by reducing the accuracy:
# Using OpenPose 1 frame, tracking the following e.g., 5 frames
./build/examples/openpose/openpose.bin --tracking 5 --number_people_max 1
  1. Runtime speed up while keeping most of the accuracy:
:: Using OpenPose 1 frame and tracking another frame
./build/examples/openpose/openpose.bin --tracking 1 --number_people_max 1
  1. Visual smoothness:
# Running both OpenPose and tracking on each frame. Note: There is no speed up/slow down
./build/examples/openpose/openpose.bin --tracking 0 --number_people_max 1

可视化结果

The visual GUI should show the original image with the poses blended on it, similarly to the pose of this gif:

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:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

FL1768317420

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值