diff --git a/.travis.yml b/.travis.yml index 13c8ca0ca..5b2d54f50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,30 +5,102 @@ branches: only: - master -# OS -dist: trusty -sudo: required +# Environment variables + OS + other parameters +global: + - GH_REPO_NAME: openpose + - DOXYFILE: $TRAVIS_BUILD_DIR/doc/doc_autogeneration.doxygen + # Set this in Environment Variables on travis-ci.org + # - GH_REPO_REF: github.com//openpose.git +matrix: + # Use a build matrix to test many builds in parallel + # envvar defaults: + # WITH_CMAKE: true + # WITH_PYTHON: false + # WITH_CUDA: true + # WITH_CUDNN: true + # WITH_OPEN_CL: false + # WITH_MKL: false + include: + # Ubuntu 16.04 + # Ubuntu 16.04 - Default - CMake - CUDA + - os: linux + dist: xenial + env: NAME="U16-default-cmake-cuda8" + sudo: required + # Generate and deploy documentation + after_success: + - cd $TRAVIS_BUILD_DIR + - chmod +x scripts/generate_gh_pages.sh + - ./scripts/generate_gh_pages.sh + # Ubuntu 16.04 - Default - CMake - CUDA - no cuDNN + - os: linux + dist: xenial + env: NAME="U16-default-cmake-cuda8-nocudnn" WITH_CUDNN=false + sudo: required + # Ubuntu 16.04 - Python - CMake - CUDA + - os: linux + dist: xenial + env: NAME="U16-python-cmake-cuda8" WITH_PYTHON=true + sudo: required + # Ubuntu 16.04 - Default - Make - CUDA + - os: linux + dist: xenial + env: NAME="U16-default-make-cuda8" WITH_CMAKE=false + sudo: required + # Ubuntu 16.04 - Default - CMake - CPU + - os: linux + dist: xenial + env: NAME="U16-default-cmake-cpu" WITH_CUDA=false + sudo: required + # # Ubuntu 16.04 - Default - CMake - CPU MKL + # - os: linux + # dist: xenial + # env: NAME="U16-default-cmake-cpu-mkl" WITH_CUDA=false WITH_MKL=true + # sudo: required + # Ubuntu 16.04 - Python - CMake - CPU + - os: linux + dist: xenial + env: NAME="U16-python-cmake-cpu" WITH_PYTHON=true WITH_CUDA=false + sudo: required + # # Ubuntu 16.04 - Default - CMake - OpenCL + # - os: linux + # dist: xenial + # env: NAME="U16-default-cmake-opencl" WITH_CUDA=false WITH_OPEN_CL=true + # sudo: required + # # Ubuntu 16.04 - Python - CMake - OpenCL + # - os: linux + # dist: xenial + # env: NAME="U16-python-cmake-opencl" WITH_PYTHON=true WITH_CUDA=false WITH_OPEN_CL=true + # sudo: required -# Environment variables -env: - global: - # - NUM_THREADS=4 - - GH_REPO_NAME: openpose - - DOXYFILE: $TRAVIS_BUILD_DIR/doc/doc_autogeneration.doxygen - # Set this in Environment Variables on travis-ci.org - # - GH_REPO_REF: github.com//openpose.git - matrix: - # Use a build matrix to test many builds in parallel - # envvar defaults: - # WITH_CMAKE: true - # WITH_PYTHON3: false - # WITH_CUDA: true - # WITH_CUDNN: true - - BUILD_NAME="default-cmake-cuda8" - # - BUILD_NAME="default-make-cuda8" WITH_CMAKE=false - - BUILD_NAME="default-cmake-cpu" WITH_CUDA=false - # - BUILD_NAME="python3-cmake-cuda8" WITH_PYTHON3=true - # - BUILD_NAME="default-make-cuda8_nocudnn" WITH_CUDNN=false + # Ubuntu 14.04 + # Ubuntu 14.04 - Default - CMake - CUDA + - os: linux + dist: trusty + env: NAME="U14-default-cmake-cuda8" + sudo: required + # Ubuntu 14.04 - Default - CMake - CPU + - os: linux + dist: trusty + env: NAME="U14-default-cmake-cpu" WITH_CUDA=false + sudo: required + # Ubuntu 14.04 - Default - Make - CUDA + - os: linux + dist: trusty + env: NAME="U14-default-make-cuda8" WITH_CMAKE=false + sudo: required + + # # Windows + # # Windows - Default - CMake - CUDA + # - os: windows + # env: NAME="W10-default-cmake-cuda8" + + # # Mac OSX + # # Mac OSX - Default - CMake - CPU + # - os: osx + # osx_image: xcode10.1 # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions + # env: NAME="OSX-default-cmake-cpu" WITH_CUDA=false + # sudo: required # Install apt dependencies addons: @@ -42,28 +114,15 @@ addons: # Install Caffe and OP dependencies install: - - sudo bash ./3rdparty/ubuntu/install_ubuntu_deps_and_cuda.sh - - sudo apt-get -y install libatlas-base-dev - - sudo apt-get -y install libopencv-dev + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash scripts/travis/install_deps_ubuntu.sh ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo bash scripts/travis/install_deps_osx.sh ; fi + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then exit 99 ; fi # Running CMake before_script: - - bash ./cmake/travis/configure.sh - # Equivalent for CMake - # - mkdir build - # - cd build - # - cmake -DBUILD_CAFFE=ON -DDOWNLOAD_BODY_25_MODEL=OFF -DDOWNLOAD_BODY_COCO_MODEL=OFF -DDOWNLOAD_FACE_MODEL=OFF -DDOWNLOAD_HAND_MODEL=OFF -DDOWNLOAD_BODY_MPI_MODEL=OFF .. + - bash scripts/travis/configure.sh # Build your code e.g., by calling make script: - - bash ./cmake/travis/run_make.sh - # - make -j`nproc` -# Equivalent to make -j`nproc` -# - no_cores=`cat /proc/cpuinfo | grep processor | wc -l` -# - make -j${no_cores} - -# Generate and deploy documentation -after_success: - - cd $TRAVIS_BUILD_DIR - - chmod +x .github/generate_gh_pages.sh - - ./.github/generate_gh_pages.sh + - bash scripts/travis/run_make.sh + - bash scripts/travis/run_tests.sh diff --git a/3rdparty/ubuntu/install_ubuntu_deps_and_cuda.sh b/3rdparty/ubuntu/install_ubuntu_deps_and_cuda.sh deleted file mode 100644 index 4d9d16074..000000000 --- a/3rdparty/ubuntu/install_ubuntu_deps_and_cuda.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -### INSTALL PREREQUISITES - -# Install CUDA 8.0 -bash 3rdparty/ubuntu/install_cuda.sh - -# Install cuDNN 5.1 -bash 3rdparty/ubuntu/install_cudnn.sh - -# Caffe prerequisites -bash 3rdparty/ubuntu/install_ubuntu_deps.sh diff --git a/3rdparty/ubuntu_deprecated/install_openpose_if_cuda8.sh b/3rdparty/ubuntu_deprecated/install_openpose_if_cuda8.sh deleted file mode 100644 index bfbe17157..000000000 --- a/3rdparty/ubuntu_deprecated/install_openpose_if_cuda8.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - - - -echo "------------------------- Installing OpenPose -------------------------" -echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail." - - - -function exitIfError { - if [[ $? -ne 0 ]] ; then - echo "" - echo "------------------------- -------------------------" - echo "Errors detected. Exiting script. The software might have not been successfully installed." - echo "------------------------- -------------------------" - exit 1 - fi -} - - - -function executeShInItsFolder { - # $1 = sh file name - # $2 = folder where the sh file is - # $3 = folder to go back - cd $2 - exitIfError - sudo chmod +x $1 - exitIfError - ./$1 - exitIfError - cd $3 - exitIfError -} - - - -echo "------------------------- Checking Ubuntu Version -------------------------" -ubuntu_version="$(lsb_release -r)" -echo "Ubuntu $ubuntu_version" -if [[ $ubuntu_version == *"14."* ]]; then - ubuntu_le_14=true -elif [[ $ubuntu_version == *"16."* || $ubuntu_version == *"15."* || $ubuntu_version == *"17."* || $ubuntu_version == *"18."* ]]; then - ubuntu_le_14=false -else - echo "Ubuntu release older than version 14. This installation script might fail." - ubuntu_le_14=true -fi -exitIfError -echo "------------------------- Ubuntu Version Checked -------------------------" -echo "" - - - -echo "------------------------- Checking Number of Processors -------------------------" -NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) -echo "$NUM_CORES cores" -exitIfError -echo "------------------------- Number of Processors Checked -------------------------" -echo "" - - - -echo "------------------------- Compiling OpenPose -------------------------" -# Go back to main folder -cd ../.. -# Copy Makefile & Makefile.config -cp 3rdparty/ubuntu/Makefile.example Makefile -if [[ $ubuntu_le_14 == true ]]; then - cp 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example Makefile.config -else - cp 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example Makefile.config -fi -# Compile OpenPose -make all -j$NUM_CORES -exitIfError -echo "------------------------- OpenPose Compiled -------------------------" -echo "" - - - -echo "------------------------- Downloading OpenPose Models -------------------------" -executeShInItsFolder "getModels.sh" "./models" ".." -exitIfError -echo "Models downloaded" -echo "------------------------- OpenPose Models Downloaded -------------------------" -echo "" - - - -echo "------------------------- OpenPose Installed -------------------------" -echo "" diff --git a/3rdparty/windows/getSpinnaker.bat b/3rdparty/windows/getSpinnaker.bat deleted file mode 100644 index 685943c44..000000000 --- a/3rdparty/windows/getSpinnaker.bat +++ /dev/null @@ -1,22 +0,0 @@ -:: Avoid printing all the comments in the Windows cmd -@echo off - -SET UNZIP_EXE=unzip\unzip.exe -SET WGET_EXE=wget\wget.exe - -:: Download temporary zip -echo ----- Downloading Caffe ----- -SET SPINNAKER_FOLDER=spinnaker\ -SET ZIP_NAME=spinnaker_2018_01_24.zip -SET ZIP_FULL_PATH=%SPINNAKER_FOLDER%%ZIP_NAME% -%WGET_EXE% -c http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/%ZIP_NAME% -P %SPINNAKER_FOLDER% -echo: - -echo ----- Unzipping Caffe ----- -%UNZIP_EXE% %ZIP_FULL_PATH% -echo: - -:: echo ----- Deleting Temporary Zip File %ZIP_FULL_PATH% ----- -:: del "%ZIP_FULL_PATH%" - -echo ----- Caffe Downloaded and Unzipped ----- diff --git a/CMakeLists.txt b/CMakeLists.txt index ba8145b5e..cf8d69226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,13 +443,13 @@ if (UNIX OR APPLE) if (NOT CUDA_FOUND) message(STATUS "CUDA not found.") - execute_process(COMMAND cat install_cuda.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/ubuntu) + execute_process(COMMAND cat install_cuda.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/scripts/ubuntu) message(FATAL_ERROR "Install CUDA using the above commands.") endif (NOT CUDA_FOUND) if (USE_CUDNN AND NOT CUDNN_FOUND) message(STATUS "cuDNN not found.") - execute_process(COMMAND cat install_cudnn.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/ubuntu) + execute_process(COMMAND cat install_cudnn.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/scripts/ubuntu) message(FATAL_ERROR "Install cuDNN using the above commands. or turn off cuDNN by setting USE_CUDNN to OFF.") endif (USE_CUDNN AND NOT CUDNN_FOUND) endif (${GPU_MODE} MATCHES "CUDA") @@ -705,10 +705,12 @@ if (UNIX OR APPLE) PREFIX ${CAFFE_PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DMKLDNN_INSTALL_DIR:PATH= + -DUSE_MKL2017_AS_DEFAULT_ENGINE=${CAFFE_CPU_ONLY} -DUSE_CUDNN=${USE_CUDNN} -DCUDA_ARCH_NAME=${CUDA_ARCH} + -DCUDA_ARCH_BIN=${CUDA_ARCH_BIN} + -DCUDA_ARCH_PTX=${CUDA_ARCH_PTX} -DCPU_ONLY=${CAFFE_CPU_ONLY} - -DUSE_MKL2017_AS_DEFAULT_ENGINE=${CAFFE_CPU_ONLY} -DCMAKE_BUILD_TYPE=Release -DBUILD_docs=OFF -DBUILD_python=OFF @@ -724,6 +726,8 @@ if (UNIX OR APPLE) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DUSE_CUDNN=${USE_CUDNN} -DCUDA_ARCH_NAME=${CUDA_ARCH} + -DCUDA_ARCH_BIN=${CUDA_ARCH_BIN} + -DCUDA_ARCH_PTX=${CUDA_ARCH_PTX} -DCPU_ONLY=${CAFFE_CPU_ONLY} -DCMAKE_BUILD_TYPE=Release -DBUILD_docs=OFF diff --git a/cmake/travis/configure-cmake.sh b/cmake/travis/configure-cmake.sh deleted file mode 100644 index e093d450b..000000000 --- a/cmake/travis/configure-cmake.sh +++ /dev/null @@ -1,28 +0,0 @@ -# CMake configuration - -mkdir build -# mkdir -p build -cd build - -ARGS="-DDOWNLOAD_BODY_25_MODEL=OFF -DDOWNLOAD_FACE_MODEL=OFF -DDOWNLOAD_HAND_MODEL=OFF" -# ARGS="-DBUILD_CAFFE=ON -DDOWNLOAD_BODY_25_MODEL=OFF -DDOWNLOAD_BODY_COCO_MODEL=OFF -DDOWNLOAD_FACE_MODEL=OFF -DDOWNLOAD_HAND_MODEL=OFF -DDOWNLOAD_BODY_MPI_MODEL=OFF" - -if $WITH_PYTHON3 ; then - ARGS="$ARGS -DBUILD_PYTHON=On" - # ARGS="$ARGS -Dpython_version=3" -fi - -if $WITH_CUDA ; then - # Only build SM50 - ARGS="$ARGS -DGPU_MODE=CUDA -DCUDA_ARCH=Manual -DCUDA_ARCH_BIN=\"52\" -DCUDA_ARCH_PTX=\"50\"" -else - ARGS="$ARGS -DGPU_MODE=CPU_ONLY -DUSE_MKL=Off" -fi - -if $WITH_CUDNN ; then - ARGS="$ARGS -DUSE_CUDNN=On" -else - ARGS="$ARGS -DUSE_CUDNN=Off" -fi - -cmake .. $ARGS diff --git a/cmake/travis/configure.sh b/cmake/travis/configure.sh deleted file mode 100644 index ef740c898..000000000 --- a/cmake/travis/configure.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# configure the project - -BASEDIR=$(dirname $0) -source $BASEDIR/defaults.sh - -if ! $WITH_CMAKE ; then - source $BASEDIR/configure-make.sh -else - source $BASEDIR/configure-cmake.sh -fi diff --git a/cmake/travis/defaults.sh b/cmake/travis/defaults.sh deleted file mode 100644 index cc1f3f5f0..000000000 --- a/cmake/travis/defaults.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# set default environment variables - -set -e - -WITH_CMAKE=${WITH_CMAKE:-true} -WITH_PYTHON3=${WITH_PYTHON3:-false} -WITH_CUDA=${WITH_CUDA:-true} -WITH_CUDNN=${WITH_CUDNN:-true} diff --git a/cmake/travis/run_make.sh b/cmake/travis/run_make.sh deleted file mode 100644 index f4862e605..000000000 --- a/cmake/travis/run_make.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# build the project - -BASEDIR=$(dirname $0) -source $BASEDIR/defaults.sh - -if $WITH_CMAKE ; then - cd build - make -j`nproc` - # make --jobs $NUM_THREADS -else # if ! $WITH_CMAKE ; then - make all -j`nproc` - # make --jobs $NUM_THREADS all -fi diff --git a/doc/contributors.md b/doc/contributors.md index 7dac41283..b8d7fd65a 100644 --- a/doc/contributors.md +++ b/doc/contributors.md @@ -12,7 +12,7 @@ OpenPose is authored by [Gines Hidalgo](https://www.gineshidalgo.com/), [Zhe Cao We would also like to thank the following people who have highly contributed to OpenPose: 1. [Yaadhav Raaj](https://www.linkedin.com/in/yaadhavraaj): OpenPose maintainer, CPU version, OpenCL version, Mac version, Python API, and person tracker. -2. [Bikramjot Hanzra](https://www.linkedin.com/in/bikz05): Former OpenPose maintainer, CMake (Ubuntu and Windows) version, and Travis Build. +2. [Bikramjot Hanzra](https://www.linkedin.com/in/bikz05): Former OpenPose maintainer, CMake (Ubuntu and Windows) version, and initial Travis Build version. 3. [Donglai Xiang](https://xiangdonglai.github.io): Camera calibration toolbox improvement, including the implementation of its bundle adjustment algorithm. 4. [Luis Fernando Fraga](https://github.com/fragalfernando): Implementation of Lukas-Kanade algorith and person ID extractor. 5. [Helen Medina](https://github.com/helen-medina): Initial Windows version. diff --git a/doc/installation.md b/doc/installation.md index 22de8ddcc..712e43eb3 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -125,14 +125,14 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH 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. 2. [**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive): - - Ubuntu: Run `sudo 3rdparty/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: Run `sudo 3rdparty/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. 3. [**cuDNN 5.1**](https://developer.nvidia.com/rdp/cudnn-archive): - - Ubuntu: Run `sudo 3rdparty/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: Run `sudo 3rdparty/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: 1. Download official AMD drivers for Windows from [**AMD - Windows**](https://support.amd.com/en-us/download). @@ -140,7 +140,7 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH 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 ./3rdparty/ubuntu/install_ubuntu_deps_and_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or run `sudo bash ./3rdparty/ubuntu/install_ubuntu_deps.sh` after installing your desired CUDA and cuDNN versions. + - Caffe prerequisites: By default, OpenPose uses Caffe under the hood. If you have not used Caffe previously, install its dependencies by running `sudo bash ./3rdparty/scripts/ubuntu/install_ubuntu_deps_and_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or run `sudo bash ./3rdparty/scripts/ubuntu/install_ubuntu_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**: - CMake automatically downloads all the Windows DLLs. Alternatively, you might prefer to download them manually: @@ -155,8 +155,8 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH - [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 3rdparty/osx/install_brew.sh` on your terminal. - - Install deps by running `bash 3rdparty/osx/install_deps.sh` on your terminal. + - 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: diff --git a/doc/installation_deprecated.md b/doc/installation_deprecated.md index 8a7e49b75..62ccba0b1 100644 --- a/doc/installation_deprecated.md +++ b/doc/installation_deprecated.md @@ -54,7 +54,7 @@ CUDA, cuDNN, OpenCV and Atlas must be already installed on your machine: ### Installation - Script Compilation Build Caffe & the OpenPose library + download the required Caffe models for Ubuntu 14.04 or 16.04 (auto-detected for the script) and CUDA 8: ```bash -bash ./3rdparty/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh +bash scripts/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh ``` **Highly important**: This script only works with CUDA 8 and Ubuntu 14 or 16. Otherwise, see [doc/installation.md](installation.md) or [Installation - Manual Compilation](#installation---manual-compilation). @@ -81,9 +81,9 @@ Alternatively to the script installation, if you want to use CUDA 7, avoid using cd ../../models/ bash ./getModels.sh # It just downloads the Caffe trained models cd .. - cp 3rdparty/ubuntu/Makefile.example Makefile + cp scripts/ubuntu/Makefile.example Makefile # Same file cp command as the one used for Caffe - cp 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example Makefile.config + cp scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example Makefile.config # Change any custom flag from the resulting Makefile.config (e.g., OpenCV 3, Atlas/OpenBLAS/MKL, etc.) make all -j`nproc` ``` @@ -95,9 +95,9 @@ Alternatively to the script installation, if you want to use CUDA 7, avoid using Note: These steps only need to be performed once. If you are interested in making changes to the OpenPose library, you can simply recompile it with: ``` make clean - make all -j$(NUM_CORES) + make all -j`nproc` ``` -**Highly important**: There are 2 `Makefile.config.Ubuntu##.example` analogous files, one in the main folder and one in [3rdparty/caffe/](../3rdparty/caffe/), corresponding to OpenPose and Caffe configuration files respectively. Any change must be done to both files (e.g., OpenCV 3 flag, Atlab/OpenBLAS/MKL flag, etc.). E.g., for CUDA 8 and Ubuntu16: [3rdparty/caffe/Makefile.config.Ubuntu16_cuda8.example](../3rdparty/caffe/Makefile.config.Ubuntu16.example) and [3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example](../3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example). +**Highly important**: There are 2 `Makefile.config.Ubuntu##.example` analogous files, one in the main folder and one in [3rdparty/caffe/](../3rdparty/caffe/), corresponding to OpenPose and Caffe configuration files respectively. Any change must be done to both files (e.g., OpenCV 3 flag, Atlab/OpenBLAS/MKL flag, etc.). E.g., for CUDA 8 and Ubuntu16: [3rdparty/caffe/Makefile.config.Ubuntu16_cuda8.example](../3rdparty/caffe/Makefile.config.Ubuntu16.example) and [scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example](../scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example). diff --git a/doc/installation_jetson_tx2_jetpack3.1.md b/doc/installation_jetson_tx2_jetpack3.1.md index 63e68cc12..808fc5b5e 100644 --- a/doc/installation_jetson_tx2_jetpack3.1.md +++ b/doc/installation_jetson_tx2_jetpack3.1.md @@ -31,7 +31,7 @@ Notes: ## Installation Use the following script for installation of both caffe and OpenPose: ``` -./3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh +./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh ``` diff --git a/doc/installation_jetson_tx2_jetpack3.3.md b/doc/installation_jetson_tx2_jetpack3.3.md index 5535d7815..3a62c85b1 100644 --- a/doc/installation_jetson_tx2_jetpack3.3.md +++ b/doc/installation_jetson_tx2_jetpack3.3.md @@ -31,7 +31,7 @@ Notes: ## Installation Use the following script for installation of both caffe and OpenPose: ``` -./3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh +./scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh ``` diff --git a/doc/release_notes.md b/doc/release_notes.md index db4f8c63f..c6a9d9276 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -301,6 +301,8 @@ OpenPose Library - Release Notes 27. Video with the 3D output can be saved with the new `--write_video_3d` flag. 28. Added Mac OpenCL compatibility. 29. Added documentation for Nvidia TX2 with JetPack 3.3. + 30. Added Travis build check for several configurations: Ubuntu (14/16)/Mac/Windows and CPU/CUDA/OpenCL and with/without Python. + 31. Assigned 755 access to all sh scripts (some of them were only 644). 2. Functions or parameters renamed: 1. By default, python example `tutorial_developer/python_2_pose_from_heatmaps.py` was using 2 scales starting at -1x736, changed to 1 scale at -1x368. 2. WrapperStructPose default parameters changed to match those of the OpenPose demo binary. @@ -313,6 +315,7 @@ OpenPose Library - Release Notes 9. Renamed `--frame_keep_distortion` as `--frame_undistort`, which performs the opposite operation (the default value has been also changed to the opposite). 10. Renamed `--camera_parameter_folder` as `--camera_parameter_path` because it could also take a whole XML file path rather than its parent folder. 11. Default value of flag `--scale_gap` changed from 0.3 to 0.25. + 12. Moved most sh scripts into the `scripts/` folder. Only models/getModels.sh and the *.bat files are kept under `models/` and `3rdparty/windows`. 3. Main bugs fixed: 1. CMake-GUI was forcing to Release mode, allowed Debug modes too. 2. NMS returns in index 0 the number of found peaks. However, while the number of peaks was truncated to a maximum of 127, this index 0 was saving the real number instead of the truncated one. @@ -322,6 +325,7 @@ OpenPose Library - Release Notes 6. Camera parameter reader can now take folder paths even if they are not finished in `/` (e.g., `~/Desktop/` worked but `~/Desktop` did not). 7. 3D module: If the image area was smaller than HD resolution image area, the 3D keypoints were not properly estimated. 8. OpenCL fixes. + 9. If manual CUDA architectures are set in CMake, they are also set for Caffe rather than only for OpenPose. diff --git a/examples/tests/README.md b/examples/tests/README.md index 1dca5a95a..d92bbc5ec 100644 --- a/examples/tests/README.md +++ b/examples/tests/README.md @@ -1,4 +1,4 @@ -# Low Level API Examples +# Test Examples **Disclaimer**: This folder is meant for internal OpenPose developers. The Examples might highly change, and we will not answer questions about them nor provide official support for them. **If the OpenPose library does not compile for an error happening due to a file from this folder, notify us**. diff --git a/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp b/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp index 2f2ac05a0..f4bffa9d5 100644 --- a/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp +++ b/examples/tutorial_api_cpp/8_synchronous_custom_output.cpp @@ -17,6 +17,7 @@ // This file should only be used for the user to take specific examples. // Command-line user intraface +#define OPENPOSE_FLAGS_DISABLE_DISPLAY #include // OpenPose dependencies #include diff --git a/models/getModels.bat b/models/getModels.bat index 857a516c9..2eccb5a14 100644 --- a/models/getModels.bat +++ b/models/getModels.bat @@ -1,7 +1,7 @@ :: Avoid printing all the comments in the Windows cmd @echo off -echo ------------------------- BODY, FACE AND HAND MODELS ------------------------- +echo ------------------------- BODY, FOOT, FACE, AND HAND MODELS ------------------------- echo ----- Downloading body pose (COCO and MPI), face and hand models ----- SET WGET_EXE=..\3rdparty\windows\wget\wget.exe SET OPENPOSE_URL=http://posefs1.perception.cs.cmu.edu/OpenPose/models/ @@ -10,7 +10,7 @@ SET FACE_FOLDER=face/ SET HAND_FOLDER=hand/ echo: -echo ------------------------- POSE MODELS ------------------------- +echo ------------------------- POSE (BODY+FOOT) MODELS ------------------------- echo Body (BODY_25) set BODY_25_FOLDER=%POSE_FOLDER%body_25/ set BODY_25_MODEL=%BODY_25_FOLDER%pose_iter_584000.caffemodel diff --git a/models/getModels.sh b/models/getModels.sh index fa340c7c7..63aef4d55 100755 --- a/models/getModels.sh +++ b/models/getModels.sh @@ -1,11 +1,11 @@ -# ------------------------- BODY, FACE AND HAND MODELS ------------------------- +# ------------------------- BODY, FOOT, FACE, AND HAND MODELS ------------------------- # Downloading body pose (COCO and MPI), face and hand models OPENPOSE_URL="http://posefs1.perception.cs.cmu.edu/OpenPose/models/" POSE_FOLDER="pose/" FACE_FOLDER="face/" HAND_FOLDER="hand/" -# ------------------------- POSE MODELS ------------------------- +# ------------------------- POSE (BODY+FOOT) MODELS ------------------------- # Body (BODY_25) BODY_25_FOLDER=${POSE_FOLDER}"body_25/" BODY_25_MODEL=${BODY_25_FOLDER}"pose_iter_584000.caffemodel" diff --git a/.github/generate_gh_pages.sh b/scripts/generate_gh_pages.sh old mode 100644 new mode 100755 similarity index 100% rename from .github/generate_gh_pages.sh rename to scripts/generate_gh_pages.sh diff --git a/3rdparty/osx/install_brew.sh b/scripts/osx/install_brew.sh similarity index 100% rename from 3rdparty/osx/install_brew.sh rename to scripts/osx/install_brew.sh diff --git a/3rdparty/osx/install_deps.sh b/scripts/osx/install_deps.sh similarity index 100% rename from 3rdparty/osx/install_deps.sh rename to scripts/osx/install_deps.sh diff --git a/examples/tests/drawProtoTxt.sh b/scripts/tests/drawProtoTxt.sh similarity index 87% rename from examples/tests/drawProtoTxt.sh rename to scripts/tests/drawProtoTxt.sh index e9696b85f..66fb0ad35 100755 --- a/examples/tests/drawProtoTxt.sh +++ b/scripts/tests/drawProtoTxt.sh @@ -8,7 +8,7 @@ # sudo apt-get install graphviz # USAGE EXAMPLE -# clear && clear && make all -j24 && bash ./examples/tests/speed_test.sh +# clear && clear && make all -j`nproc` && bash ./scripts/tests/speed_test.sh # # Go back to main folder # cd ../../ diff --git a/examples/tests/hand_accuracy_test.sh b/scripts/tests/hand_accuracy_test.sh similarity index 96% rename from examples/tests/hand_accuracy_test.sh rename to scripts/tests/hand_accuracy_test.sh index 0d2294249..050bcd052 100755 --- a/examples/tests/hand_accuracy_test.sh +++ b/scripts/tests/hand_accuracy_test.sh @@ -9,7 +9,7 @@ # Step 1 - Getting JSON output # Running it: # Run it from OpenPose main folder with the following command: - # clear && clear && make all -j`nproc` && bash ./examples/tests/hand_accuracy_test.sh + # clear && clear && make all -j`nproc` && bash ./scripts/tests/hand_accuracy_test.sh # Image paths: # Read that script for details about all the paths and change them for your own paths. diff --git a/examples/tests/pose_accuracy_car_val.sh b/scripts/tests/pose_accuracy_car_val.sh old mode 100644 new mode 100755 similarity index 95% rename from examples/tests/pose_accuracy_car_val.sh rename to scripts/tests/pose_accuracy_car_val.sh index 82c7dd5b4..aa113e43b --- a/examples/tests/pose_accuracy_car_val.sh +++ b/scripts/tests/pose_accuracy_car_val.sh @@ -7,7 +7,7 @@ clear && clear # USAGE EXAMPLE -# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_test.sh +# clear && clear && make all -j`nproc` && bash ./scripts/tests/pose_accuracy_coco_test.sh # # Go back to main folder # cd ../../ diff --git a/examples/tests/pose_accuracy_coco_test_dev.sh b/scripts/tests/pose_accuracy_coco_test_dev.sh similarity index 90% rename from examples/tests/pose_accuracy_coco_test_dev.sh rename to scripts/tests/pose_accuracy_coco_test_dev.sh index 8a79d6a2f..c8daded65 100755 --- a/examples/tests/pose_accuracy_coco_test_dev.sh +++ b/scripts/tests/pose_accuracy_coco_test_dev.sh @@ -3,7 +3,7 @@ # USAGE EXAMPLE -# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_test_dev.sh +# clear && clear && make all -j`nproc` && bash ./scripts/tests/pose_accuracy_coco_test_dev.sh # Script for internal use. We might completely change it continuously and we will not answer questions about it. diff --git a/examples/tests/pose_accuracy_coco_val.sh b/scripts/tests/pose_accuracy_coco_val.sh similarity index 93% rename from examples/tests/pose_accuracy_coco_val.sh rename to scripts/tests/pose_accuracy_coco_val.sh index 82531cddb..17133cf08 100755 --- a/examples/tests/pose_accuracy_coco_val.sh +++ b/scripts/tests/pose_accuracy_coco_val.sh @@ -3,7 +3,7 @@ # USAGE EXAMPLE -# clear && clear && make all -j`nproc` && bash ./examples/tests/pose_accuracy_coco_val.sh +# clear && clear && make all -j`nproc` && bash ./scripts/tests/pose_accuracy_coco_val.sh # Script for internal use. We might completely change it continuously and we will not answer questions about it. diff --git a/examples/tests/pose_accuracy_coco_val_foot.sh b/scripts/tests/pose_accuracy_coco_val_foot.sh old mode 100644 new mode 100755 similarity index 93% rename from examples/tests/pose_accuracy_coco_val_foot.sh rename to scripts/tests/pose_accuracy_coco_val_foot.sh index 1d58a5cda..f8efd3dc4 --- a/examples/tests/pose_accuracy_coco_val_foot.sh +++ b/scripts/tests/pose_accuracy_coco_val_foot.sh @@ -7,7 +7,7 @@ clear && clear # USAGE EXAMPLE -# See ./examples/tests/pose_accuracy_coco_test.sh +# See ./scripts/tests/pose_accuracy_coco_test.sh # Parameters IMAGE_FOLDER=/home/gines/devel/images/val2017/ diff --git a/examples/tests/pose_time_Caffe_layers.sh b/scripts/tests/pose_time_Caffe_layers.sh similarity index 100% rename from examples/tests/pose_time_Caffe_layers.sh rename to scripts/tests/pose_time_Caffe_layers.sh diff --git a/examples/tests/pose_time_visual_GUI.sh b/scripts/tests/pose_time_visual_GUI.sh similarity index 91% rename from examples/tests/pose_time_visual_GUI.sh rename to scripts/tests/pose_time_visual_GUI.sh index 54e33e087..504f1d648 100755 --- a/examples/tests/pose_time_visual_GUI.sh +++ b/scripts/tests/pose_time_visual_GUI.sh @@ -8,7 +8,7 @@ # cd ../../ # Re-build -clear && clear && make all -j12 +clear && clear && make all -j`nproc` # Performance results (~1400) ./build/examples/openpose/openpose.bin --video soccer.mp4 --frame_last 1500 diff --git a/examples/tests/speed_test.sh b/scripts/tests/speed_test.sh similarity index 86% rename from examples/tests/speed_test.sh rename to scripts/tests/speed_test.sh index 5eb5fe4aa..b240409ca 100755 --- a/examples/tests/speed_test.sh +++ b/scripts/tests/speed_test.sh @@ -5,7 +5,7 @@ # Script for internal use. We might completely change it continuously and we will not answer questions about it. # USAGE EXAMPLE -# clear && clear && make all -j24 && bash ./examples/tests/speed_test.sh +# clear && clear && make all -j`nproc` && bash ./scripts/tests/speed_test.sh # # Go back to main folder # cd ../../ diff --git a/scripts/travis/configure.sh b/scripts/travis/configure.sh new file mode 100755 index 000000000..5425c5527 --- /dev/null +++ b/scripts/travis/configure.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Configure the project + +BASEDIR=$(dirname $0) +source $BASEDIR/defaults.sh + +echo "WITH_CMAKE = ${WITH_CMAKE}." +if [[ $WITH_CMAKE == true ]] ; then + echo "Running CMake configuration..." + source $BASEDIR/configure_cmake.sh +else + echo "Running Makefile configuration..." + source $BASEDIR/configure_make.sh +fi diff --git a/scripts/travis/configure_cmake.sh b/scripts/travis/configure_cmake.sh new file mode 100755 index 000000000..321280abb --- /dev/null +++ b/scripts/travis/configure_cmake.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# CMake configuration + +mkdir build +cd build + +echo "RUN_EXAMPLES = ${RUN_EXAMPLES}." +if [[ $RUN_EXAMPLES == true ]] ; then + ARGS="-DDOWNLOAD_FACE_MODEL=OFF -DDOWNLOAD_HAND_MODEL=OFF" +else + ARGS="-DDOWNLOAD_BODY_25_MODEL=OFF -DDOWNLOAD_FACE_MODEL=OFF -DDOWNLOAD_HAND_MODEL=OFF" + # ARGS="-DBUILD_CAFFE=ON -DDOWNLOAD_BODY_25_MODEL=OFF -DDOWNLOAD_BODY_COCO_MODEL=OFF -DDOWNLOAD_FACE_MODEL=OFF -DDOWNLOAD_HAND_MODEL=OFF -DDOWNLOAD_BODY_MPI_MODEL=OFF" +fi + +echo "WITH_PYTHON = ${WITH_PYTHON}." +if [[ $WITH_PYTHON == true ]] ; then + ARGS="$ARGS -DBUILD_PYTHON=On" +fi + +# CUDA version +echo "WITH_CUDA = ${WITH_CUDA}." +echo "WITH_OPEN_CL = ${WITH_OPEN_CL}." +echo "WITH_MKL = ${WITH_MKL}." +if [[ $WITH_CUDA == true ]] ; then + # Only build SM50 + ARGS="$ARGS -DGPU_MODE=CUDA -DCUDA_ARCH=Manual -DCUDA_ARCH_BIN=\"52\" -DCUDA_ARCH_PTX=\"\"" +# OpenCL version +elif [[ $WITH_OPEN_CL == true ]] ; then + echo "OpenCL version not implemented for Travis Build yet." + exit 99 +# CPU version +else + ARGS="$ARGS -DGPU_MODE=CPU_ONLY" + # MKL (Intel Caffe) + if [[ $WITH_MKL == true ]] ; then + ARGS="$ARGS -DUSE_MKL=On" + else + ARGS="$ARGS -DUSE_MKL=Off" + fi +fi + +echo "WITH_CUDNN = ${WITH_CUDNN}." +if [[ $WITH_CUDNN == true ]] ; then + ARGS="$ARGS -DUSE_CUDNN=On" +else + ARGS="$ARGS -DUSE_CUDNN=Off" +fi + +echo "ARGS = ${ARGS}." + +cmake .. $ARGS diff --git a/scripts/travis/configure_make.sh b/scripts/travis/configure_make.sh new file mode 100755 index 000000000..5a147c2c1 --- /dev/null +++ b/scripts/travis/configure_make.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Raw Makefile configuration +# # All in one line +# bash scripts/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh + +if [[ $MAKE_CONFIG_COMPATIBLE == false ]] ; then + echo "Configuration not compatible for Makefile." + exit 99 +fi + +LINE () { + echo "$@" >> Makefile.config + echo "$@" >> 3rdparty/caffe/Makefile.config +} + +# Install Caffe +echo "Installing Caffe..." +cd ./3rdparty/caffe +bash install_caffe_if_cuda8.sh +cd ../.. + +# Generate Makefile files for OpenPose +echo "Generating Makefile files for OpenPose..." +bash scripts/ubuntu_deprecated/copy_makefile_files.sh + +echo "WITH_CUDA = ${WITH_CUDA}." +if [[ $WITH_CUDA == true ]] ; then + # Only build SM50 + LINE "CUDA_ARCH := -gencode arch=compute_50,code=sm_50" +else + LINE "CPU_ONLY := 1" +fi + +echo "WITH_CUDNN = ${WITH_CUDNN}." +if [[ $WITH_CUDNN == true ]] ; then + LINE "USE_CUDNN := 1" +fi diff --git a/scripts/travis/defaults.sh b/scripts/travis/defaults.sh new file mode 100755 index 000000000..e5354f301 --- /dev/null +++ b/scripts/travis/defaults.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Set default environment variables +set -e +WITH_CMAKE=${WITH_CMAKE:-true} +WITH_PYTHON=${WITH_PYTHON:-false} +WITH_CUDA=${WITH_CUDA:-true} +WITH_CUDNN=${WITH_CUDNN:-true} +WITH_OPEN_CL=${WITH_OPEN_CL:-false} +WITH_MKL=${WITH_MKL:-false} + +# Examples should be run (Travis not compatible with GPU code) +# if [[ $WITH_CMAKE == true ]] && [[ $WITH_PYTHON == true ]] && [[ $WITH_CUDA == false ]] && [[ $WITH_OPEN_CL == false ]] && [[ $WITH_MKL == false ]]; then +if [[ $WITH_CUDA == false ]] && [[ $WITH_OPEN_CL == false ]]; then + RUN_EXAMPLES=true +else + RUN_EXAMPLES=false +fi +echo "RUN_EXAMPLES = ${RUN_EXAMPLES}." + +# Makefile configuration compatible +if [[ $WITH_PYTHON == false ]] ; then + MAKE_CONFIG_COMPATIBLE=true +else + MAKE_CONFIG_COMPATIBLE=false +fi +echo "MAKE_CONFIG_COMPATIBLE = ${MAKE_CONFIG_COMPATIBLE}." diff --git a/scripts/travis/install_deps_osx.sh b/scripts/travis/install_deps_osx.sh new file mode 100755 index 000000000..83ed340cf --- /dev/null +++ b/scripts/travis/install_deps_osx.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Install dependencies for Mac OSX +echo "Running on Mac OSX." + +echo "Mac OSX version not implemented for Travis Build testing." +exit 99 diff --git a/scripts/travis/install_deps_ubuntu.sh b/scripts/travis/install_deps_ubuntu.sh new file mode 100755 index 000000000..07f800a32 --- /dev/null +++ b/scripts/travis/install_deps_ubuntu.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Install dependencies for Ubuntu +echo "Running on ${TRAVIS_OS_NAME} OS." + +BASEDIR=$(dirname $0) +source $BASEDIR/defaults.sh + +if [[ $WITH_CUDA == true ]] ; then + sudo bash scripts/ubuntu/install_ubuntu_deps_and_cuda.sh +else + sudo bash scripts/ubuntu/install_ubuntu_deps.sh +fi +sudo apt-get -y install libatlas-base-dev +sudo apt-get -y install libopencv-dev diff --git a/scripts/travis/run_make.sh b/scripts/travis/run_make.sh new file mode 100755 index 000000000..a5c136b99 --- /dev/null +++ b/scripts/travis/run_make.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Build the project + +BASEDIR=$(dirname $0) +source $BASEDIR/defaults.sh + +if [[ $WITH_CMAKE == true ]] ; then + cd build + make -j`nproc` +else + make all -j`nproc` +fi diff --git a/scripts/travis/run_tests.sh b/scripts/travis/run_tests.sh new file mode 100755 index 000000000..193c69bba --- /dev/null +++ b/scripts/travis/run_tests.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Test the project + +BASEDIR=$(dirname $0) +source $BASEDIR/defaults.sh + +# Only for NAME="default-cmake-cpu" WITH_CUDA=false +if [[ $RUN_EXAMPLES == true ]] ; then + echo "Running demos and tutorials..." + echo " " + + echo "OpenPose demo..." + ./build/examples/openpose/openpose.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --display 0 --render_pose 0 + echo " " + + echo "Tutorial Add Moduel: Example 1..." + ./build/examples/tutorial_add_module/1_custom_post_processing.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --display 0 --render_pose 0 + echo " " + + # # Note: Examples 1-5 and 8-9 require GUI + # echo "Tutorial API C++: Examples 1-5 and 8-9..." + # ./build/examples/tutorial_api_cpp/1_body_from_image.bin + # ./build/examples/tutorial_api_cpp/2_whole_body_from_image.bin + # ./build/examples/tutorial_api_cpp/3_keypoints_from_image_configurable.bin --net_resolution -1x32 + # ./build/examples/tutorial_api_cpp/4_asynchronous_loop_custom_input_and_output.bin --net_resolution -1x32 --image_dir examples/media/ + # ./build/examples/tutorial_api_cpp/8_synchronous_custom_output.bin --net_resolution -1x32 --image_dir examples/media/ + # ./build/examples/tutorial_api_cpp/9_synchronous_custom_all.bin --net_resolution -1x32 --image_dir examples/media/ + # echo " " + + echo "Tutorial API C++: Example 6..." + ./build/examples/tutorial_api_cpp/6_synchronous_custom_postprocessing.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --display 0 --render_pose 0 + echo " " + + echo "Tutorial API C++: Example 7..." + ./build/examples/tutorial_api_cpp/7_synchronous_custom_input.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --display 0 --render_pose 0 + echo " " + + # Python examples + if [[ $WITH_PYTHON == true ]] ; then + echo "Python API C++: Example 1..." + echo "TODO: Add Python examples in here..." + echo " " + fi + + echo "Demos and tutorials successfully finished!" + +# Disable examples for all other Travis Build configurations +else + echo "Skipping tests for non CPU-only versions." + exit 0 +fi diff --git a/3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 b/scripts/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 similarity index 100% rename from 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 rename to scripts/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 diff --git a/3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe b/scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe similarity index 100% rename from 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe rename to scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe diff --git a/3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose b/scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose similarity index 100% rename from 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose rename to scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose diff --git a/3rdparty/ubuntu/Makefile.example b/scripts/ubuntu/Makefile.example similarity index 100% rename from 3rdparty/ubuntu/Makefile.example rename to scripts/ubuntu/Makefile.example diff --git a/3rdparty/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh b/scripts/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh old mode 100644 new mode 100755 similarity index 82% rename from 3rdparty/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh rename to scripts/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh index 22043cabe..891306788 --- a/3rdparty/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh +++ b/scripts/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh @@ -26,15 +26,6 @@ echo "" -echo "------------------------- Checking Number of Processors -------------------------" -NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) -echo "$NUM_CORES cores" -exitIfError -echo "------------------------- Number of Processors Checked -------------------------" -echo "" - - - echo "------------------------- Installing some Caffe Dependencies -------------------------" # Basic sudo apt-get --assume-yes update @@ -56,9 +47,9 @@ echo "" echo "------------------------- Compiling Caffe -------------------------" cp Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe Makefile.config -make all -j$NUM_CORES && make distribute -j$NUM_CORES -# make test -j$NUM_CORES -# make runtest -j$NUM_CORES +make all -j`nproc` && make distribute -j`nproc` +# make test -j`nproc` +# make runtest -j`nproc` exitIfError echo "------------------------- Caffe Compiled -------------------------" echo "" diff --git a/3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh b/scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh old mode 100644 new mode 100755 similarity index 97% rename from 3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh rename to scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh index 57639c4c1..01f47799b --- a/3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh +++ b/scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh @@ -41,7 +41,7 @@ exitIfError -executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./3rdparty/ubuntu/" "./" +executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./scripts/ubuntu/" "./" exitIfError diff --git a/3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh b/scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh old mode 100644 new mode 100755 similarity index 81% rename from 3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh rename to scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh index 63244e61e..201cdab11 --- a/3rdparty/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh +++ b/scripts/ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.3.sh @@ -36,14 +36,14 @@ function executeShInItsFolder { rm -r ./3rdparty/caffe git submodule update --init --recursive -mv ./3rdparty/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh ./3rdparty/caffe/install_caffe_JetsonTX2_JetPack3.3.sh -mv ./3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe ./3rdparty/caffe/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe +mv ./scripts/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh ./3rdparty/caffe/install_caffe_JetsonTX2_JetPack3.3.sh +mv ./scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe ./3rdparty/caffe/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe executeShInItsFolder "install_caffe_JetsonTX2_JetPack3.3.sh" "./3rdparty/caffe" "../.." exitIfError -executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.3.sh" "./3rdparty/ubuntu/" "./" +executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.3.sh" "./scripts/ubuntu/" "./" exitIfError diff --git a/3rdparty/ubuntu/install_cuda.sh b/scripts/ubuntu/install_cuda.sh old mode 100644 new mode 100755 similarity index 100% rename from 3rdparty/ubuntu/install_cuda.sh rename to scripts/ubuntu/install_cuda.sh diff --git a/3rdparty/ubuntu/install_cudnn.sh b/scripts/ubuntu/install_cudnn.sh old mode 100644 new mode 100755 similarity index 100% rename from 3rdparty/ubuntu/install_cudnn.sh rename to scripts/ubuntu/install_cudnn.sh diff --git a/3rdparty/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh b/scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh old mode 100644 new mode 100755 similarity index 78% rename from 3rdparty/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh rename to scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh index 9eac19c22..cd15038ba --- a/3rdparty/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh +++ b/scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.1.sh @@ -25,7 +25,7 @@ function executeShInItsFolder { exitIfError sudo chmod +x $1 exitIfError - ./$1 + bash ./$1 exitIfError cd $3 exitIfError @@ -40,23 +40,14 @@ echo "" -echo "------------------------- Checking Number of Processors -------------------------" -NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) -echo "$NUM_CORES cores" -exitIfError -echo "------------------------- Number of Processors Checked -------------------------" -echo "" - - - echo "------------------------- Compiling OpenPose -------------------------" # Go back to main folder cd ../.. # Copy Makefile & Makefile.config -cp 3rdparty/ubuntu/Makefile.example Makefile -cp 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 Makefile.config +cp scripts/ubuntu/Makefile.example Makefile +cp scripts/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 Makefile.config # Compile OpenPose -make all -j$NUM_CORES +make all -j`nproc` exitIfError echo "------------------------- OpenPose Compiled -------------------------" echo "" diff --git a/3rdparty/ubuntu/install_openpose_JetsonTX2_JetPack3.3.sh b/scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.3.sh old mode 100644 new mode 100755 similarity index 78% rename from 3rdparty/ubuntu/install_openpose_JetsonTX2_JetPack3.3.sh rename to scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.3.sh index 671692e8e..188e58dbf --- a/3rdparty/ubuntu/install_openpose_JetsonTX2_JetPack3.3.sh +++ b/scripts/ubuntu/install_openpose_JetsonTX2_JetPack3.3.sh @@ -25,7 +25,7 @@ function executeShInItsFolder { exitIfError sudo chmod +x $1 exitIfError - ./$1 + bash ./$1 exitIfError cd $3 exitIfError @@ -40,23 +40,14 @@ echo "" -echo "------------------------- Checking Number of Processors -------------------------" -NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu) -echo "$NUM_CORES cores" -exitIfError -echo "------------------------- Number of Processors Checked -------------------------" -echo "" - - - echo "------------------------- Compiling OpenPose -------------------------" # Go back to main folder cd ../.. # Copy Makefile & Makefile.config -cp 3rdparty/ubuntu/Makefile.example_openpose Makefile -cp 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose Makefile.config +cp scripts/ubuntu/Makefile.example_openpose Makefile +cp scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose Makefile.config # Compile OpenPose -make all -j$NUM_CORES +make all -j`nproc` exitIfError echo "------------------------- OpenPose Compiled -------------------------" echo "" diff --git a/3rdparty/ubuntu/install_ubuntu_deps.sh b/scripts/ubuntu/install_ubuntu_deps.sh old mode 100644 new mode 100755 similarity index 100% rename from 3rdparty/ubuntu/install_ubuntu_deps.sh rename to scripts/ubuntu/install_ubuntu_deps.sh diff --git a/scripts/ubuntu/install_ubuntu_deps_and_cuda.sh b/scripts/ubuntu/install_ubuntu_deps_and_cuda.sh new file mode 100755 index 000000000..d09b1150d --- /dev/null +++ b/scripts/ubuntu/install_ubuntu_deps_and_cuda.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +### INSTALL PREREQUISITES + +# Install CUDA 8.0 +bash scripts/ubuntu/install_cuda.sh + +# Install cuDNN 5.1 +bash scripts/ubuntu/install_cudnn.sh + +# Caffe prerequisites +bash scripts/ubuntu/install_ubuntu_deps.sh diff --git a/3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example similarity index 100% rename from 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example rename to scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example diff --git a/3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example similarity index 100% rename from 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example rename to scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example diff --git a/3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda7.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda7.example similarity index 100% rename from 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda7.example rename to scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda7.example diff --git a/3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example similarity index 100% rename from 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example rename to scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example diff --git a/scripts/ubuntu_deprecated/copy_makefile_files.sh b/scripts/ubuntu_deprecated/copy_makefile_files.sh new file mode 100755 index 000000000..47e575d61 --- /dev/null +++ b/scripts/ubuntu_deprecated/copy_makefile_files.sh @@ -0,0 +1,53 @@ +#!/bin/bash + + + +echo "------------------------- Preprocessing -------------------------" +echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail." + + + +function exitIfError { + if [[ $? -ne 0 ]] ; then + echo "" + echo "------------------------- -------------------------" + echo "Errors detected. Exiting script. The software might have not been successfully installed." + echo "------------------------- -------------------------" + exit 1 + fi +} + + + +echo "------------------------- Checking Ubuntu Version -------------------------" +ubuntu_version="$(lsb_release -r)" +echo "Ubuntu $ubuntu_version" +if [[ $ubuntu_version == *"14."* ]]; then + ubuntu_le_14=true +elif [[ $ubuntu_version == *"16."* || $ubuntu_version == *"15."* || $ubuntu_version == *"17."* || $ubuntu_version == *"18."* ]]; then + ubuntu_le_14=false +else + echo "Ubuntu release older than version 14. This installation script might fail." + ubuntu_le_14=true +fi +exitIfError +echo "------------------------- Ubuntu Version Checked -------------------------" +echo "" + + + +echo "------------------------- Copying Required Files -------------------------" +# Copy Makefile & Makefile.config +cp scripts/ubuntu/Makefile.example Makefile +if [[ $ubuntu_le_14 == true ]]; then + cp scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example Makefile.config +else + cp scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example Makefile.config +fi +exitIfError +echo "------------------------- Required Files Copied -------------------------" + + + +echo "------------------------- Preprocessing Ready -------------------------" +echo "" diff --git a/3rdparty/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh b/scripts/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh old mode 100644 new mode 100755 similarity index 92% rename from 3rdparty/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh rename to scripts/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh index 337a8d2aa..4a9edc536 --- a/3rdparty/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh +++ b/scripts/ubuntu_deprecated/install_caffe_and_openpose_if_cuda8.sh @@ -41,7 +41,7 @@ exitIfError -executeShInItsFolder "install_openpose_if_cuda8.sh" "./3rdparty/ubuntu_deprecated/" "./" +executeShInItsFolder "install_openpose_if_cuda8.sh" "./scripts/ubuntu_deprecated/" "./" exitIfError diff --git a/scripts/ubuntu_deprecated/install_openpose_if_cuda8.sh b/scripts/ubuntu_deprecated/install_openpose_if_cuda8.sh new file mode 100755 index 000000000..5c39bd40a --- /dev/null +++ b/scripts/ubuntu_deprecated/install_openpose_if_cuda8.sh @@ -0,0 +1,59 @@ +#!/bin/bash + + + +echo "------------------------- Installing OpenPose -------------------------" + + + +function exitIfError { + if [[ $? -ne 0 ]] ; then + echo "" + echo "------------------------- -------------------------" + echo "Errors detected. Exiting script. The software might have not been successfully installed." + echo "------------------------- -------------------------" + exit 1 + fi +} + + + +function executeShInItsFolder { + # $1 = sh file name + # $2 = folder where the sh file is + # $3 = folder to go back + cd $2 + exitIfError + sudo chmod +x $1 + exitIfError + bash ./$1 + exitIfError + cd $3 + exitIfError +} + + + +executeShInItsFolder "scripts/ubuntu_deprecated/copy_makefile_files.sh" "../.." "./" + + + +echo "------------------------- Compiling OpenPose -------------------------" +make all -j`nproc` +exitIfError +echo "------------------------- OpenPose Compiled -------------------------" +echo "" + + + +echo "------------------------- Downloading OpenPose Models -------------------------" +executeShInItsFolder "getModels.sh" "./models" ".." +exitIfError +echo "Models downloaded" +echo "------------------------- OpenPose Models Downloaded -------------------------" +echo "" + + + +echo "------------------------- OpenPose Installed -------------------------" +echo ""