diff --git a/.github/issue_template.md b/.github/issue_template.md index 89e73fbc2ca6ce000fc12f1b1015e7c29dccd68a..8694ee7254026b322472c32977fd506c84b87f15 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -78,4 +78,4 @@ You might select multiple topics, delete the rest: - Portable demo or compiled library? 10. If **speed performance** issue: - - Report OpenPose timing speed based on [this link](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#profiling-speed). + - Report OpenPose timing speed based on [this link](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/speed_up_openpose.md#profiling-speed). diff --git a/CMakeLists.txt b/CMakeLists.txt index 9395309127c0668775d28df7e1ccf4536132c36f..f08155438a5e1b4ec6cc3bbf464c9ea654ed07c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,12 +10,27 @@ set(CMAKE_MACOSX_RPATH 1) ### CMAKE HEADERS -if (${CMAKE_VERSION} VERSION_GREATER 3.0.0) - cmake_policy(SET CMP0048 NEW) - project(OpenPose VERSION ${OpenPose_VERSION}) -else (${CMAKE_VERSION} VERSION_GREATER 3.0.0) - project(OpenPose) -endif (${CMAKE_VERSION} VERSION_GREATER 3.0.0) +# Ubuntu 18 default. After 3.8, no need for find_CUDA +# https://cmake.org/cmake/help/v3.10/module/FindCUDA.html +# https://cmake.org/cmake/help/v3.10/command/project.html +# https://devblogs.nvidia.com/building-cuda-applications-cmake/ +if (${CMAKE_VERSION} VERSION_GREATER 3.9.0) + cmake_policy(SET CMP0048 NEW) + project(OpenPose VERSION ${OpenPose_VERSION}) + # # Not tested + # cmake_policy(SET CMP0048 NEW) + # set(CUDACXX /usr/local/cuda/bin/nvcc) + # project(OpenPose VERSION ${OpenPose_VERSION} LANGUAGES CXX CUDA) + # set(AUTO_FOUND_CUDA TRUE) + # # else + # set(AUTO_FOUND_CUDA FALSE) +# Ubuntu 16 default +elseif (${CMAKE_VERSION} VERSION_GREATER 3.0.0) + cmake_policy(SET CMP0048 NEW) + project(OpenPose VERSION ${OpenPose_VERSION}) +else (${CMAKE_VERSION} VERSION_GREATER 3.9.0) + project(OpenPose) +endif (${CMAKE_VERSION} VERSION_GREATER 3.9.0) cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) # min. cmake version recommended by Caffe diff --git a/README.md b/README.md index fa97222fefa805f3739dedf12a854f0a21f8faa1..bf11a43cd409b7253d5f82dbdd2e9e6ae93f5fe4 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Output (format, keypoint index ordering, etc.) in [doc/output.md](doc/output.md) ## Speeding Up OpenPose and Benchmark -Check the OpenPose Benchmark as well as some hints to speed up and/or reduce the memory requirements for OpenPose on [doc/speed_up_preserving_accuracy.md](doc/speed_up_preserving_accuracy.md). +Check the OpenPose Benchmark as well as some hints to speed up and/or reduce the memory requirements for OpenPose on [doc/speed_up_openpose.md](doc/speed_up_openpose.md). diff --git a/doc/faq.md b/doc/faq.md index de8790e374c71ebb5c79a7cc0a53bdeb2c1180ec..d7c1f224b8ff2a25ace327e5cb3b029c3aad3995 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -37,19 +37,19 @@ OpenPose - Frequently Asked Question (FAQ) ### Speed Up, Memory Reduction, and Benchmark **Q: Low speed** - OpenPose is quite slow, is it normal? How can I speed it up? -**A**: Check [doc/speed_up_preserving_accuracy.md](./speed_up_preserving_accuracy.md) to discover the approximate speed of your graphics card and some speed tips. +**A**: Check [doc/speed_up_openpose.md](./speed_up_openpose.md) to discover the approximate speed of your graphics card and some speed tips. ### CPU Version Too Slow **Q: The CPU version is insanely slow compared to the GPU version.** -**A**: Check [doc/speed_up_preserving_accuracy.md#cpu-version](./speed_up_preserving_accuracy.md#cpu-version) to discover the approximate speed and some speed tips. +**A**: Check [doc/speed_up_openpose.md#cpu-version](./speed_up_openpose.md#cpu-version) to discover the approximate speed and some speed tips. ### Profiling Speed and Estimating FPS without Display -Check the [doc/installation.md#profiling-speed](./installation.md#profiling-speed) section. +Check the [doc/speed_up_openpose.md#profiling-speed](./speed_up_openpose.md#profiling-speed) section. @@ -109,7 +109,7 @@ COCO model will eventually be removed. BODY_25 model is faster, more accurate, a ### How to Measure the Latency Time? **Q: How to measure/calculate/estimate the latency/lag time?** -**A**: [Profile](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#profiling-speed) the OpenPose speed. For 1-GPU or CPU-only systems (use `--disable_multi_thread` for simplicity in multi-GPU systems for latency measurement), the latency will be roughly the sum of all the reported measurements. +**A**: [Profile](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/speed_up_openpose.md#profiling-speed) the OpenPose speed. For 1-GPU or CPU-only systems (use `--disable_multi_thread` for simplicity in multi-GPU systems for latency measurement), the latency will be roughly the sum of all the reported measurements. diff --git a/doc/installation.md b/doc/installation.md index bbd9471ee88cfb1cfaeebafe60d7c9f3f676f491..67379ab1e8503e82d48e131bc939a504b44c96ab 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -11,20 +11,19 @@ OpenPose - Installation 7. [Reinstallation](#reinstallation) 8. [Uninstallation](#uninstallation) 9. [Optional Settings](#optional-settings) - 1. [Profiling Speed](#profiling-speed) - 2. [Faster GUI Display](#faster-gui-display) - 3. [COCO and MPI Models](#coco-and-mpi-models) - 4. [Python API](#python-api) - 5. [CPU Version](#cpu-version) - 6. [OpenCL Version](#opencl-version) - 7. [Mac OSX Version](#mac-osx-version) - 8. [3D Reconstruction Module](#3d-reconstruction-module) - 9. [Calibration Module](#calibration-module) - 10. [Compiling without cuDNN](#compiling-without-cudnn) - 11. [Custom Caffe (Ubuntu Only)](#custom-caffe-ubuntu-only) - 12. [Custom OpenCV (Ubuntu Only)](#custom-opencv-ubuntu-only) - 13. [Doxygen Documentation Autogeneration (Ubuntu Only)](#doxygen-documentation-autogeneration-ubuntu-only) - 14. [CMake Command Line Configuration (Ubuntu Only)](#cmake-command-line-configuration-ubuntu-only) + 1. [Maximum Speed](#maximum-speed) + 2. [COCO and MPI Models](#coco-and-mpi-models) + 3. [Python API](#python-api) + 4. [CPU Version](#cpu-version) + 5. [OpenCL Version](#opencl-version) + 6. [Mac OSX Version](#mac-osx-version) + 7. [3D Reconstruction Module](#3d-reconstruction-module) + 8. [Calibration Module](#calibration-module) + 9. [Compiling without cuDNN](#compiling-without-cudnn) + 10. [Custom Caffe (Ubuntu Only)](#custom-caffe-ubuntu-only) + 11. [Custom OpenCV (Ubuntu Only)](#custom-opencv-ubuntu-only) + 12. [Doxygen Documentation Autogeneration (Ubuntu Only)](#doxygen-documentation-autogeneration-ubuntu-only) + 13. [CMake Command Line Configuration (Ubuntu Only)](#cmake-command-line-configuration-ubuntu-only) @@ -36,8 +35,8 @@ This installation section is only intended if you plan to modify the OpenPose co ## Operating Systems -- **Ubuntu** 14 and 16. -- **Windows** 7, 8, 10. +- **Ubuntu** 14, 16, 18. +- **Windows** 7, 8, 10. Note: Only CUDA 8 and graphic cards up to 10XX series. **20XX series and V100 graphic cards are not compatible yet** (check GitHub issue #996 for updates). - **Mac OSX** Mavericks and above. - **Nvidia Jetson TX2** (for JetPack 3.1 or 3.3), installation instructions in [doc/installation_jetson_tx2_jetpack3.1.md](./installation_jetson_tx2_jetpack3.1.md) and [doc/installation_jetson_tx2_jetpack3.3.md](./installation_jetson_tx2_jetpack3.3.md) respectively. - OpenPose has also been used on **Windows 7**, **CentOS**, and **Nvidia Jetson (TK1 and TX1)** embedded systems. However, we do not officially support them at the moment. @@ -111,59 +110,96 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH ### Prerequisites +**Very important**: New Nvidia model GPUs (e.g., Nvidia V, GTX 2080, v100, any Nvidia with Volta or Turing architecture, etc.) require (at least) CUDA 10. CUDA 8 would fail! + +In addition, CMake automatically downloads all the OpenPose models. However, **some firewall or company networks block these downloads**. You might prefer to download them manually: + - [BODY_25 model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/body_25/pose_iter_584000.caffemodel): download in `models/pose/body_25/`. + - [COCO model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel): download in `models/pose/coco/`. + - [MPI model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/mpi/pose_iter_160000.caffemodel): download in `models/pose/mpi/`. + - [Face model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/face/pose_iter_116000.caffemodel): download in `models/face/`. + - [Hands model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel): download in `models/hand/`. + +#### Ubuntu Prerequisites 1. Ubuntu - **Anaconda should not be installed** on your system. Anaconda includes a Protobuf version that is incompatible with Caffe. Either you uninstall anaconda and install protobuf via apt-get, or you compile your own Caffe and link it to OpenPose. -2. Download and install CMake GUI: - - Ubuntu: run the command `sudo apt-get install cmake-qt-gui`. Note: If you prefer to use CMake through the command line, see [CMake Command Line Configuration (Ubuntu Only)](#cmake-command-line-configuration-ubuntu-only). - - Windows: download and install the latest CMake win64-x64 msi installer from the [CMake website](https://cmake.org/download/), called `cmake-X.X.X-win64-x64.msi`. - - Mac: `brew cask install cmake`. -3. Windows - **Microsoft Visual Studio (VS) 2015 Enterprise Update 3**: +2. Install **CMake GUI**: + - Ubuntu 14 or 16: run the command `sudo apt-get install cmake-qt-gui`. Note: If you prefer to use CMake through the command line, see [CMake Command Line Configuration (Ubuntu Only)](#cmake-command-line-configuration-ubuntu-only). + - Ubuntu 18: **Download and compile CMake-gui from source**. The default CMake-gui version (3.10) installed via `sudo apt-get install cmake-qt-gui` provokes some compiling errors. Required CMake version >= 3.12. + - Uninstall your current Cmake-gui version by running `sudo apt purge cmake-qt-gui`. + - Run `sudo apt-get install qtbase5-dev`. + - Download the `Latest Release` of `CMake Unix/Linux Source` from the [CMake download website](https://cmake.org/download/), called `cmake-X.X.X.tar.gz`. + - Unzip it and go inside that folder from the terminal. + - Run `./configure --qt-gui`. Make sure no error occurred. + - Run `./bootstrap && make -j8 && make install -j8`. Make sure no error occurred. + - Assuming your CMake downloaded folder is in {CMAKE_FOLDER_PATH}, everytime these instructions mentions `cmake-gui`, you will have to replace that line by `{CMAKE_FOLDER_PATH}/bin/cmake-gui`. +3. Nvidia GPU version prerequisites: + 1. **Note: OpenPose has been tested extensively with CUDA 8.0 (cuDNN 5.1) and CUDA 10.0 (cuDNN 7.2)**. We highly recommend using those versions to minimize potential installation issues. Other versions should also work, but we do not provide support about any CUDA/cuDNN installation/compilation issue, as well as problems relate dto their integration into OpenPose. + 2. **CUDA**: + - Ubuntu 14 or 16 ([**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive) **or 10**): Run `sudo ./scripts/ubuntu/install_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or alternatively download and install it from their website. + - Ubuntu 18 ([**CUDA 10**](https://developer.nvidia.com/cuda-downloads)): Download the latest Nvidia CUDA version from their [official website](https://developer.nvidia.com/cuda-downloads). + - Select "Linux" -> "x86_64" -> "Ubuntu" -> "18.04" -> "runtime (local)", and download it. + - Follow the Nvidia website installation instructions. Make sure to enable the symbolic link in `usr/local/cuda` to minimize potential future errors. + 3. **cuDNN**: + - Ubuntu 14 or 16 ([**cuDNN 5.1**](https://developer.nvidia.com/rdp/cudnn-archive) **or 7.2**): Run `sudo ./scripts/ubuntu/install_cudnn.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or alternatively download and install it from their website. + - Ubuntu 18 ([**cuDNN 7.2**](https://developer.nvidia.com/cudnn)): Download and install it from the [Nvidia website](https://developer.nvidia.com/cudnn). +5. AMD GPU version prerequisites: + 1. Ubuntu 14 or 16: + 1. Download 3rd party ROCM driver for Ubuntu from [**AMD - OpenCL**](https://rocm.github.io/ROCmInstall.html). + 2. Install `sudo apt-get install libviennacl-dev`. + 2. Ubuntu 18: Not tested and not officially supported. Try at your risk. +6. Install **Caffe, OpenCV, and Caffe prerequisites**: + - Caffe prerequisites: By default, OpenPose uses Caffe under the hood. If you have not used Caffe previously, install its dependencies by running `sudo bash ./scripts/ubuntu/install_deps_and_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or run `sudo bash ./scripts/ubuntu/install_deps.sh` after installing your desired CUDA and cuDNN versions. + - OpenCV must be already installed on your machine. It can be installed with `apt-get install libopencv-dev`. You can also use your own compiled OpenCV version. +7. **Eigen prerequisite** (optional, only required for some specific extra functionality, such as extrinsic camera calibration): + - If you enable the `WITH_EIGEN` flag when running CMake. You can either: + 1. Do not do anything if you set the `WITH_EIGEN` flag to `BUILD`, CMake will automatically download Eigen. Alternatively, you might prefer to download it manually: + - [Eigen3](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/eigen_2018_05_23.zip): Unzip as `3rdparty/eigen/`. + 2. Run `sudo apt-get install libeigen3-dev` if you prefer to set `WITH_EIGEN` to `APT_GET`. + 3. Use your own version of Eigen by setting `WITH_EIGEN` to `BUILD`, run CMake so that OpenPose downloads the zip file, and then replace the contents of `3rdparty/eigen/` by your own version. + +#### Mac OS Prerequisites +1. If you don't have `brew`, install it by running `bash scripts/osx/install_brew.sh` on your terminal. +2. Install **CMake GUI**: Run the command `brew cask install cmake`. +3. Install **Caffe, OpenCV, and Caffe prerequisites**: Run `bash scripts/osx/install_deps.sh`. +4. **Eigen prerequisite** (optional, only required for some specific extra functionality, such as extrinsic camera calibration): + - Enable the `WITH_EIGEN` flag when running CMake, and set it to `BUILD`. + - CMake will automatically download Eigen. + - Alternatively, you can manually download it from the [Eigen3 website](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/eigen_2018_05_23.zip), and unzip as `3rdparty/eigen/`. + +#### Windows Prerequisites +NOTE: These instructions are only required when compiling OpenPose brom source. If you simply wanna use the OpenPose binaries for Windows, skip this step. + +1. Install **CMake GUI**: Download and install the `Latest Release` of CMake `Windows win64-x64 Installer` from the [CMake download website](https://cmake.org/download/), called `cmake-X.X.X-win64-x64.msi`. +2. Install **Microsoft Visual Studio (VS) 2015 Enterprise Update 3**: - **IMPORTANT**: Enable all C++-related flags when selecting the components to install. - Different VS versions: - If **Visual Studio 2017 Community** is desired, we do not officially support it, but it might be compiled by firstly [enabling CUDA 8.0 in VS2017](https://stackoverflow.com/questions/43745099/using-cuda-with-visual-studio-2017?answertab=active#tab-top) or use **VS2017 with CUDA 9** by checking the `.vcxproj` file and changing the necessary paths from CUDA 8 to 9. - VS 2015 Enterprise Update 1 will give some compiler errors. - VS 2015 Community has not been tested. -4. Nvidia GPU version prerequisites: - 1. **Note: OpenPose has been tested extensively with CUDA 8.0 and cuDNN 5.1**. We highly recommend using those versions to minimize potential installation issues. Other versions should also work, but we do not provide support about any CUDA/cuDNN installation/compilation issue, as well as problems relate dto their integration into OpenPose. +3. Nvidia GPU version prerequisites: + 1. **Note: OpenPose has been tested extensively with CUDA 8.0 and cuDNN 5.1**. We highly recommend using those versions to minimize potential installation issues. Other versions should also work, but we do not provide support about any CUDA/cuDNN installation/compilation issue, as well as problems related to their integration into OpenPose. 2. [**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive): - Ubuntu: Run `sudo ./scripts/ubuntu/install_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or alternatively download and install it from their website. - Windows: Install CUDA 8.0 after Visual Studio 2015 is installed to assure that the CUDA installation will generate all necessary files for VS. If CUDA was already installed, re-install it. - **Important installation tips**: - - New Nvidia model GPUs (e.g., Nvidia V, GTX 2080, any Nvidia with Volta or Turing architecture, etc.) require at least CUDA 9. - (Windows issue, reported Sep 2018): If your computer hangs when installing CUDA drivers, try installing first the [Nvidia drivers](http://www.nvidia.com/Download/index.aspx), and then installing CUDA without the Graphics Driver flag. - - (Windows): If CMake returns and error message similar to `CUDA_TOOLKIT_ROOT_DIR not found or specified` or any other CUDA component missing, then: 1) Re-install Visual Studio 2015; 2) Reboot your PC; 3) Re-install CUDA. + - If CMake returns and error message similar to `CUDA_TOOLKIT_ROOT_DIR not found or specified` or any other CUDA component missing, then: 1) Re-install Visual Studio 2015; 2) Reboot your PC; 3) Re-install CUDA (in this order!). 3. [**cuDNN 5.1**](https://developer.nvidia.com/rdp/cudnn-archive): - Ubuntu: Run `sudo ./scripts/ubuntu/install_cudnn.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or alternatively download and install it from their website. - Windows (and Ubuntu if manual installation): In order to manually install it, just unzip it and copy (merge) the contents on the CUDA folder, usually `/usr/local/cuda/` in Ubuntu and `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0` in Windows. -5. AMD GPU version prerequisites: +4. AMD GPU version prerequisites: 1. Download official AMD drivers for Windows from [**AMD - Windows**](https://support.amd.com/en-us/download). - 2. Download 3rd party ROCM driver for Ubuntu from [**AMD - OpenCL**](https://rocm.github.io/ROCmInstall.html). - 3. Ubuntu only: Install `sudo apt-get install libviennacl-dev`. This comes packaged inside OpenPose for Windows. - 4. AMD Drivers have not been tested on OSX. Please email us if you wish to test it. This has only been tested on Vega series cards. -6. Ubuntu - Other prerequisites: - - Caffe prerequisites: By default, OpenPose uses Caffe under the hood. If you have not used Caffe previously, install its dependencies by running `sudo bash ./scripts/ubuntu/install_deps_and_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or run `sudo bash ./scripts/ubuntu/install_deps.sh` after installing your desired CUDA and cuDNN versions. - - OpenCV must be already installed on your machine. It can be installed with `apt-get install libopencv-dev`. You can also use your own compiled OpenCV version. -7. Windows - **Caffe, OpenCV, and Caffe prerequisites**: + 2. The libviennacl package comes packaged inside OpenPose for Windows (i.e., no further action required). +5. **Caffe, OpenCV, and Caffe prerequisites**: - CMake automatically downloads all the Windows DLLs. Alternatively, you might prefer to download them manually: - - Models: - - [COCO model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel): download in `models/pose/coco/`. - - [MPI model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/mpi/pose_iter_160000.caffemodel): download in `models/pose/mpi/`. - - [Face model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/face/pose_iter_116000.caffemodel): download in `models/face/`. - - [Hands model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel): download in `models/hand/`. - Dependencies: - Note: Leave the zip files in `3rdparty/windows/` so that CMake does not try to download them again. - [Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_2018_01_18.zip): Unzip as `3rdparty/windows/caffe/`. - [Caffe dependencies](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe3rdparty_2017_07_14.zip): Unzip as `3rdparty/windows/caffe3rdparty/`. - [OpenCV 3.1](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/opencv_310.zip): Unzip as `3rdparty/windows/opencv/`. -8. Mac - **Caffe, OpenCV, and Caffe prerequisites**: - - If you don't have `brew`, install it with `bash scripts/osx/install_brew.sh` on your terminal. - - Install deps by running `bash scripts/osx/install_deps.sh` on your terminal. -9. **Eigen prerequisite**: - - Note: This step is optional, only required for some specific extra functionality, such as extrinsic camera calibration. - - If you enable the `WITH_EIGEN` flag when running CMake. You can either: - 1. Do not do anything if you set the `WITH_EIGEN` flag to `BUILD`, CMake will automatically download Eigen. Alternatively, you might prefer to download it manually: - - [Eigen3](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/eigen_2018_05_23.zip): Unzip as `3rdparty/eigen/`. - 2. Run `sudo apt-get install libeigen3-dev` (Ubuntu only) if you prefer to set `WITH_EIGEN` to `APT_GET` (Ubuntu only). - 3. Use your own version of Eigen by setting `WITH_EIGEN` to `BUILD`, run CMake so that OpenPose downloads the zip file, and then replace the contents of `3rdparty/eigen/` by your own version. +6. **Eigen prerequisite** (optional, only required for some specific extra functionality, such as extrinsic camera calibration): + - Enable the `WITH_EIGEN` flag when running CMake, and set it to `BUILD`. + - CMake will automatically download Eigen. + - Alternatively, you can manually download it from the [Eigen3 website](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/eigen_2018_05_23.zip), run CMake so that OpenPose downloads the zip file, and then replace the contents of `3rdparty/eigen/` by your own version. @@ -265,18 +301,8 @@ In order to uninstall OpenPose: ### Optional Settings -#### Profiling Speed -OpenPose displays the FPS in the basic GUI. However, more complex speed metrics can be obtained from the command line while running OpenPose. In order to obtain those, compile OpenPose with the `PROFILER_ENABLED` flag. OpenPose will automatically display time measurements for each subthread after processing `F` frames (by default `F = 1000`, but it can be modified with the `--profile_speed` flag). - -- Time measurement for 1 graphic card: The FPS will be the slowest time displayed in your terminal command line (as OpenPose is multi-threaded). Times are in milliseconds, so `FPS = 1000/millisecond_measurement`. -- Time measurement for >1 graphic cards: Assuming `n` graphic cards, you will have to wait up to `n` x `F` frames to visualize each graphic card speed (as the frames are splitted among them). In addition, the FPS would be: `FPS = minFPS(speed_per_GPU/n, worst_time_measurement_other_than_GPUs)`. For < 4 GPUs, this is usually `FPS = speed_per_GPU/n`. - -Make sure that `wPoseExtractor` time is the slowest timing. Otherwise the input producer (video/webcam codecs issues with OpenCV, images too big, etc.) or the GUI display (use OpenGL support as detailed in [doc/speed_up_preserving_accuracy.md](./speed_up_preserving_accuracy.md)) might not be optimized. - - - -#### Faster GUI Display -Reduce the lag and increase the speed of displaying images by enabling the `WITH_OPENCV_WITH_OPENCL` flag. It tells OpenCV to render the images using OpenGL support. This speeds up rendering about 3x. E.g., it reduces from about 30 msec to about 10 msec the display time for HD resolution images. It requires OpenCV to be compiled with OpenGL support and it provokes a visual aspect-ratio artifact when rendering a folder with images of different resolutions. +#### Maximum Speed +Check the OpenPose Benchmark as well as some hints to speed up and/or reduce the memory requirements for OpenPose on [doc/speed_up_openpose.md](./speed_up_openpose.md). @@ -308,7 +334,7 @@ export MKL_NUM_THREADS="8" export OMP_NUM_THREADS="8" ``` -Do note that increasing the number of threads results in more memory use. You can check the [doc/speed_up_preserving_accuracy.md](./speed_up_preserving_accuracy.md) for more information about speed and memory requirements in several CPUs and GPUs. +Do note that increasing the number of threads results in more memory use. You can check the [doc/speed_up_openpose.md](./speed_up_openpose.md) for more information about speed and memory requirements in several CPUs and GPUs. diff --git a/doc/speed_up_openpose.md b/doc/speed_up_openpose.md new file mode 100644 index 0000000000000000000000000000000000000000..de86606d065f6fe854864ee0bf1bc8e77609fd07 --- /dev/null +++ b/doc/speed_up_openpose.md @@ -0,0 +1,51 @@ +OpenPose - Maximizing the OpenPose Speed +======================================================================================== + +## Contents +1. [OpenPose Benchmark](#openpose-benchmark) +2. [Profiling Speed](#profiling-speed) +3. [CPU Version](#cpu-version) +4. [Speed Up Preserving Accuracy](#speed-up-preserving-accuracy) +5. [Speed Up and Memory Reduction](#speed-up-and-memory-reduction) + + + + + +## OpenPose Benchmark +Check the [OpenPose Benchmark](https://docs.google.com/spreadsheets/d/1-DynFGvoScvfWDA1P4jDInCkbD4lg0IKOYbXgEq0sK0/edit#gid=0) to discover the approximate expected speed of your graphics card. + + + +### CPU Version +The CPU version runs at about 0.3 FPS on the COCO model, and at about 0.1 FPS (i.e., about 15 sec / frame) on the default BODY_25 model. Switch to COCO model and/or reduce the `net_resolution` as indicated above. Contradictory fact: BODY_25 model is about 5x slower than COCO on CPU-only version, but it is about 40% faster on GPU version. + + + +### Profiling Speed +OpenPose displays the FPS in the basic GUI. However, more complex speed metrics can be obtained from the command line while running OpenPose. In order to obtain those, compile OpenPose with the `PROFILER_ENABLED` flag on CMake-gui. OpenPose will automatically display time measurements for each subthread after processing `F` frames (by default `F = 1000`, but it can be modified with the `--profile_speed` flag, e.g. `--profile_speed 100`). + +- Time measurement for 1 graphic card: The FPS will be the slowest time displayed in your terminal command line (as OpenPose is multi-threaded). Times are in milliseconds, so `FPS = 1000/millisecond_measurement`. +- Time measurement for >1 graphic cards: Assuming `n` graphic cards, you will have to wait up to `n` x `F` frames to visualize each graphic card speed (as the frames are splitted among them). In addition, the FPS would be: `FPS = minFPS(speed_per_GPU/n, worst_time_measurement_other_than_GPUs)`. For < 4 GPUs, this is usually `FPS = speed_per_GPU/n`. + +Make sure that `wPoseExtractor` time is the slowest timing. Otherwise the input producer (video/webcam codecs issues with OpenCV, images too big, etc.) or the GUI display (use OpenGL support as detailed in [doc/speed_up_openpose.md](./speed_up_openpose.md)) might not be optimized. + + + +## Speed Up Preserving Accuracy +Some speed tips to maximize the OpenPose runtime speed while preserving the accuracy (do not expect miracles, but it might help a bit boosting the framerate): + + 1. Enable the `WITH_OPENCV_WITH_OPENGL` flag in CMake to have a much faster GUI display. It reduces the lag and increase the speed of displaying images by telling OpenCV to render the images using OpenGL support. This speeds up display rendering about 3x. E.g., it reduces from about 30 msec to about 3-10 msec the display time for HD resolution images. It requires OpenCV to be compiled with OpenGL support and it provokes a visual aspect-ratio artifact when rendering a folder with images of different resolutions. Note: Default OpenCV in Ubuntu 16 (from apt-get install) does have OpenGL support included. Nevertheless, default one from Ubuntu 18 and the Windows portable binaries do not. + 2. Change GPU rendering by CPU rendering to get approximately +0.5 FPS (`--render_pose 1`). + 3. Use cuDNN 5.1 or 7.2 (cuDNN 6 is ~10% slower). + 4. Use the `BODY_25` model for simultaneously maximum speed and accuracy (both COCO and MPII models are slower and less accurate). But it does increase the GPU memory, so it might go out of memory more easily in low-memory GPUs. + + + +## Speed Up and Memory Reduction +Some speed tips to highly maximize the OpenPose speed, but keep in mind the accuracy trade-off: + + 1. Reduce the `--net_resolution` (e.g., to 320x176) (lower accuracy). Note: For maximum accuracy, follow [doc/quick_start.md#maximum-accuracy-configuration](./quick_start.md#maximum-accuracy-configuration). + 2. For face, reduce the `--face_net_resolution`. The resolution 320x320 usually works pretty decently. + 3. Points 1-2 will also reduce the GPU memory usage (or RAM memory for CPU version). + 4. Use the `BODY_25` model for maximum speed. Use `MPI_4_layers` model for minimum GPU memory usage (but lower accuracy, speed, and number of parts). diff --git a/doc/speed_up_preserving_accuracy.md b/doc/speed_up_preserving_accuracy.md deleted file mode 100644 index 2513edbb7ed0c0c791deffbe934842de19a85b31..0000000000000000000000000000000000000000 --- a/doc/speed_up_preserving_accuracy.md +++ /dev/null @@ -1,46 +0,0 @@ -OpenPose - Maximizing the OpenPose Speed -======================================================================================== - -## Contents -1. [OpenPose Benchmark](#openpose-benchmark) -2. [Profiling Speed](#profiling-speed) -3. [Speed Up Preserving Accuracy](#speed-up-preserving-accuracy) -4. [Speed Up and Memory Reduction](#speed-up-and-memory-reduction) -5. [CPU Version](#cpu-version) - - - - - -## OpenPose Benchmark -Check the [OpenPose Benchmark](https://docs.google.com/spreadsheets/d/1-DynFGvoScvfWDA1P4jDInCkbD4lg0IKOYbXgEq0sK0/edit#gid=0) to discover the approximate expected speed of your graphics card. - - - -### Profiling Speed -Check the [doc/installation.md#profiling-speed](./installation.md#profiling-speed) section to measure the bottlenecks in your OpenPose distribution and make sure everything is working as expected. - - - -## Speed Up Preserving Accuracy -Some speed tips to maximize the OpenPose runtime speed while preserving the accuracy (do not expect miracles, but it might help a bit boosting the framerate): - - 1. Enable the `WITH_OPENCV_WITH_OPENGL` flag in CMake to have a much faster GUI display (but you must also compile OpenCV with OpenGL support). Note: Default OpenCV in Ubuntu (from apt-get install) does have OpenGL support included. Nevertheless, default Windows portable binaries do not. - 2. Change GPU rendering by CPU rendering to get approximately +0.5 FPS (`--render_pose 1`). - 3. Use cuDNN 5.1 (cuDNN 6 is ~10% slower). - 4. Use the `BODY_25` model for simultaneously maximum speed and accuracy (both COCO and MPII models are slower and less accurate). - - - -## Speed Up and Memory Reduction -Some speed tips to highly maximize the OpenPose speed, but keep in mind the accuracy trade-off: - - 1. Reduce the `--net_resolution` (e.g., to 320x176) (lower accuracy). Note: For maximum accuracy, follow [doc/quick_start.md#maximum-accuracy-configuration](./quick_start.md#maximum-accuracy-configuration). - 2. For face, reduce the `--face_net_resolution`. The resolution 320x320 usually works pretty decently. - 3. Points 1-2 will also reduce the GPU memory usage (or RAM memory for CPU version). - 4. Use the `BODY_25` model for maximum speed. Use `MPI_4_layers` model for minimum GPU memory usage (but lower accuracy, speed, and number of parts). - - - -### CPU Version -The CPU version runs at about 0.3 FPS on the COCO model, and at about 0.1 FPS (i.e., about 15 sec / frame) on the default BODY_25 model. Switch to COCO model and/or reduce the `net_resolution` as indicated above. Contradictory fact: BODY_25 model is about 5x slower than COCO on CPU-only version, but it is about 40% faster on GPU version. diff --git a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example index 2cd6f0ae4cf30a630d56e18effe38fddc06470e2..9af0eb15b3cb0d134e6ab2caebd38184ba44bca9 100644 --- a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example +++ b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example @@ -40,7 +40,6 @@ CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_61,code=sm_61 \ -gencode arch=compute_62,code=sm_62 \ -gencode arch=compute_70,code=sm_70 \ - -gencode arch=compute_71,code=sm_71 \ -gencode arch=compute_72,code=sm_72 \ -gencode arch=compute_75,code=sm_75 \ -gencode arch=compute_75,code=compute_75 diff --git a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example index c4de79e335182eed1bdfd1bd4e32a3cbd2d79752..43f21b711ef0baee9cac7fb7436b5ca8f24f0dcd 100644 --- a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example +++ b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example @@ -40,7 +40,6 @@ CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_61,code=sm_61 \ -gencode arch=compute_62,code=sm_62 \ -gencode arch=compute_70,code=sm_70 \ - -gencode arch=compute_71,code=sm_71 \ -gencode arch=compute_72,code=sm_72 \ -gencode arch=compute_72,code=compute_72