2018/11/04 Updated by

OpenPose

Windows上でデモを動かしてみる


[Up] Japanese English

CPU 版

  1. プロジェクトのURL
  2. https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases
  3. githubのソースの doc/installation.md のWindows Portable Demoを読むと動かし方がわかる。
  4. Release から Windows 用のバイナリ(CPU版) openpose-1.4.0-win64-cpu-binaries.zip をダウンロードする。
  5. https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases
  6. 展開すると openpose-1.4.0-win64-cpu-binaries/ができるので、その中の Instructions.txt を読んで指示に従う。
  7. models/getModels.bat をダブルクリックする。モデルがダウンロードされる。
  8. クィックスタートを読むこと。 https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/v1.4.0/doc/quick_start.md
  9. ビデオで動かす
  10. Video on Windows
    :: 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
    
    
    Video on Windows
    :: 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
    
    
  11. Webcamで動かす
  12. Webcam on Windows
    :: Windows - Portable Demo
    bin\OpenPoseDemo.exe
    :: With face and hands
    bin\OpenPoseDemo.exe --face --hand
    
    
    Webcam on Windows
    :: 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
    
    
  13. Imageで動かす
  14. Image on Windows
    :: Windows - Portable Demo
    bin\OpenPoseDemo.exe --image_dir examples\media\
    :: With face and hands
    bin\OpenPoseDemo.exe --image_dir examples\media\ --face --hand
    
    
    Image on Windows
    :: 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
    
    
  15. Webcamのデモを動かすと非常に重い。1枚の画像を処理するのに3秒(?)くらいかかっているようだ。
  16.     bin\OpenPoseDemo
    
  17. ドキュメント類はこちら。 https://github.com/CMU-Perceptual-Computing-Lab/openpose/tree/v1.4.0/doc/

GPU 版

  1. Release から Windows 用のバイナリ GPU 版をダウンロードする。 https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases openpose-1.4.0-win64-gpu-binaries_recommended.zip
  2. あとの手順は CPU 版と同じ。
  3. GTX980m のPCでデモを動かしてみた。
  4.     bin\OpenPoseDemo
    

    オプション無しの "bin\OpenPoseDemo" だと 1秒に15枚くらい(?)は処理できている感じで、 リアルタイム処理できそう。

        bin\OpenPoseDemo --hand --face
    

    顔と手の認識をさせると、いきなり重くなって 1秒に5枚くらい(?)しか処理できない。


Max Accuracy
:: 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


Max Accuracy
:: 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


save
# 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 --camera_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


load
# 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}


reconstruct
# Ubuntu and Mac (same flags for Windows version)
# Assuming >=2 cameras and reconstruction when at least 2 visible views
./build/examples/openpose/openpose.bin --flir_camera --3d --number_people_max 1 --3d_min_views 2 --output_resolution {desired_output_resolution}