未验证 提交 f4453850 编写于 作者: G Gines 提交者: GitHub

Added Travis build for CPU/CUDA/U16/U14 (#1003)

上级 5c6072b4
...@@ -5,30 +5,102 @@ branches: ...@@ -5,30 +5,102 @@ branches:
only: only:
- master - master
# OS # Environment variables + OS + other parameters
dist: trusty global:
sudo: required - 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/<user_name>/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 # Ubuntu 14.04
env: # Ubuntu 14.04 - Default - CMake - CUDA
global: - os: linux
# - NUM_THREADS=4 dist: trusty
- GH_REPO_NAME: openpose env: NAME="U14-default-cmake-cuda8"
- DOXYFILE: $TRAVIS_BUILD_DIR/doc/doc_autogeneration.doxygen sudo: required
# Set this in Environment Variables on travis-ci.org # Ubuntu 14.04 - Default - CMake - CPU
# - GH_REPO_REF: github.com/<user_name>/openpose.git - os: linux
matrix: dist: trusty
# Use a build matrix to test many builds in parallel env: NAME="U14-default-cmake-cpu" WITH_CUDA=false
# envvar defaults: sudo: required
# WITH_CMAKE: true # Ubuntu 14.04 - Default - Make - CUDA
# WITH_PYTHON3: false - os: linux
# WITH_CUDA: true dist: trusty
# WITH_CUDNN: true env: NAME="U14-default-make-cuda8" WITH_CMAKE=false
- BUILD_NAME="default-cmake-cuda8" sudo: required
# - BUILD_NAME="default-make-cuda8" WITH_CMAKE=false
- BUILD_NAME="default-cmake-cpu" WITH_CUDA=false # # Windows
# - BUILD_NAME="python3-cmake-cuda8" WITH_PYTHON3=true # # Windows - Default - CMake - CUDA
# - BUILD_NAME="default-make-cuda8_nocudnn" WITH_CUDNN=false # - 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 # Install apt dependencies
addons: addons:
...@@ -42,28 +114,15 @@ addons: ...@@ -42,28 +114,15 @@ addons:
# Install Caffe and OP dependencies # Install Caffe and OP dependencies
install: install:
- sudo bash ./3rdparty/ubuntu/install_ubuntu_deps_and_cuda.sh - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash scripts/travis/install_deps_ubuntu.sh ; fi
- sudo apt-get -y install libatlas-base-dev - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo bash scripts/travis/install_deps_osx.sh ; fi
- sudo apt-get -y install libopencv-dev - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then exit 99 ; fi
# Running CMake # Running CMake
before_script: before_script:
- bash ./cmake/travis/configure.sh - bash scripts/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 ..
# Build your code e.g., by calling make # Build your code e.g., by calling make
script: script:
- bash ./cmake/travis/run_make.sh - bash scripts/travis/run_make.sh
# - make -j`nproc` - bash scripts/travis/run_tests.sh
# 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
:: 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 -----
...@@ -443,13 +443,13 @@ if (UNIX OR APPLE) ...@@ -443,13 +443,13 @@ if (UNIX OR APPLE)
if (NOT CUDA_FOUND) if (NOT CUDA_FOUND)
message(STATUS "CUDA not 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.") message(FATAL_ERROR "Install CUDA using the above commands.")
endif (NOT CUDA_FOUND) endif (NOT CUDA_FOUND)
if (USE_CUDNN AND NOT CUDNN_FOUND) if (USE_CUDNN AND NOT CUDNN_FOUND)
message(STATUS "cuDNN not 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.") 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 (USE_CUDNN AND NOT CUDNN_FOUND)
endif (${GPU_MODE} MATCHES "CUDA") endif (${GPU_MODE} MATCHES "CUDA")
...@@ -705,10 +705,12 @@ if (UNIX OR APPLE) ...@@ -705,10 +705,12 @@ if (UNIX OR APPLE)
PREFIX ${CAFFE_PREFIX} PREFIX ${CAFFE_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DMKLDNN_INSTALL_DIR:PATH=<INSTALL_DIR> -DMKLDNN_INSTALL_DIR:PATH=<INSTALL_DIR>
-DUSE_MKL2017_AS_DEFAULT_ENGINE=${CAFFE_CPU_ONLY}
-DUSE_CUDNN=${USE_CUDNN} -DUSE_CUDNN=${USE_CUDNN}
-DCUDA_ARCH_NAME=${CUDA_ARCH} -DCUDA_ARCH_NAME=${CUDA_ARCH}
-DCUDA_ARCH_BIN=${CUDA_ARCH_BIN}
-DCUDA_ARCH_PTX=${CUDA_ARCH_PTX}
-DCPU_ONLY=${CAFFE_CPU_ONLY} -DCPU_ONLY=${CAFFE_CPU_ONLY}
-DUSE_MKL2017_AS_DEFAULT_ENGINE=${CAFFE_CPU_ONLY}
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
-DBUILD_docs=OFF -DBUILD_docs=OFF
-DBUILD_python=OFF -DBUILD_python=OFF
...@@ -724,6 +726,8 @@ if (UNIX OR APPLE) ...@@ -724,6 +726,8 @@ if (UNIX OR APPLE)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DUSE_CUDNN=${USE_CUDNN} -DUSE_CUDNN=${USE_CUDNN}
-DCUDA_ARCH_NAME=${CUDA_ARCH} -DCUDA_ARCH_NAME=${CUDA_ARCH}
-DCUDA_ARCH_BIN=${CUDA_ARCH_BIN}
-DCUDA_ARCH_PTX=${CUDA_ARCH_PTX}
-DCPU_ONLY=${CAFFE_CPU_ONLY} -DCPU_ONLY=${CAFFE_CPU_ONLY}
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
-DBUILD_docs=OFF -DBUILD_docs=OFF
......
# 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
#!/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
#!/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}
...@@ -12,7 +12,7 @@ OpenPose is authored by [Gines Hidalgo](https://www.gineshidalgo.com/), [Zhe Cao ...@@ -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: 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. 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. 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. 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. 5. [Helen Medina](https://github.com/helen-medina): Initial Windows version.
...@@ -125,14 +125,14 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH ...@@ -125,14 +125,14 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH
4. Nvidia GPU version prerequisites: 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. 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): 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. - 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**: - **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. - 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 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. - (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): 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. - 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: 5. AMD GPU version prerequisites:
1. Download official AMD drivers for Windows from [**AMD - Windows**](https://support.amd.com/en-us/download). 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 ...@@ -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. 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. 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: 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. - 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**: 7. Windows - **Caffe, OpenCV, and Caffe prerequisites**:
- CMake automatically downloads all the Windows DLLs. Alternatively, you might prefer to download them manually: - 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 ...@@ -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/`. - [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/`. - [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**: 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. - If you don't have `brew`, install it with `bash scripts/osx/install_brew.sh` on your terminal.
- Install deps by running `bash 3rdparty/osx/install_deps.sh` on your terminal. - Install deps by running `bash scripts/osx/install_deps.sh` on your terminal.
9. **Eigen prerequisite**: 9. **Eigen prerequisite**:
- Note: This step is optional, only required for some specific extra functionality, such as extrinsic camera calibration. - 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: - If you enable the `WITH_EIGEN` flag when running CMake. You can either:
......
...@@ -54,7 +54,7 @@ CUDA, cuDNN, OpenCV and Atlas must be already installed on your machine: ...@@ -54,7 +54,7 @@ CUDA, cuDNN, OpenCV and Atlas must be already installed on your machine:
### Installation - Script Compilation ### 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: 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
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). **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 ...@@ -81,9 +81,9 @@ Alternatively to the script installation, if you want to use CUDA 7, avoid using
cd ../../models/ cd ../../models/
bash ./getModels.sh # It just downloads the Caffe trained models bash ./getModels.sh # It just downloads the Caffe trained models
cd .. cd ..
cp 3rdparty/ubuntu/Makefile.example Makefile cp scripts/ubuntu/Makefile.example Makefile
# Same file cp command as the one used for Caffe # 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.) # Change any custom flag from the resulting Makefile.config (e.g., OpenCV 3, Atlas/OpenBLAS/MKL, etc.)
make all -j`nproc` make all -j`nproc`
``` ```
...@@ -95,9 +95,9 @@ Alternatively to the script installation, if you want to use CUDA 7, avoid using ...@@ -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: 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 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).
......
...@@ -31,7 +31,7 @@ Notes: ...@@ -31,7 +31,7 @@ Notes:
## Installation ## Installation
Use the following script for installation of both caffe and OpenPose: 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
``` ```
......
...@@ -31,7 +31,7 @@ Notes: ...@@ -31,7 +31,7 @@ Notes:
## Installation ## Installation
Use the following script for installation of both caffe and OpenPose: 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
``` ```
......
...@@ -301,6 +301,8 @@ OpenPose Library - Release Notes ...@@ -301,6 +301,8 @@ OpenPose Library - Release Notes
27. Video with the 3D output can be saved with the new `--write_video_3d` flag. 27. Video with the 3D output can be saved with the new `--write_video_3d` flag.
28. Added Mac OpenCL compatibility. 28. Added Mac OpenCL compatibility.
29. Added documentation for Nvidia TX2 with JetPack 3.3. 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: 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. 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. 2. WrapperStructPose default parameters changed to match those of the OpenPose demo binary.
...@@ -313,6 +315,7 @@ OpenPose Library - Release Notes ...@@ -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). 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. 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. 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: 3. Main bugs fixed:
1. CMake-GUI was forcing to Release mode, allowed Debug modes too. 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. 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 ...@@ -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). 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. 7. 3D module: If the image area was smaller than HD resolution image area, the 3D keypoints were not properly estimated.
8. OpenCL fixes. 8. OpenCL fixes.
9. If manual CUDA architectures are set in CMake, they are also set for Caffe rather than only for OpenPose.
......
# 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. **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**. **If the OpenPose library does not compile for an error happening due to a file from this folder, notify us**.
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
// This file should only be used for the user to take specific examples. // This file should only be used for the user to take specific examples.
// Command-line user intraface // Command-line user intraface
#define OPENPOSE_FLAGS_DISABLE_DISPLAY
#include <openpose/flags.hpp> #include <openpose/flags.hpp>
// OpenPose dependencies // OpenPose dependencies
#include <openpose/headers.hpp> #include <openpose/headers.hpp>
......
:: Avoid printing all the comments in the Windows cmd :: Avoid printing all the comments in the Windows cmd
@echo off @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 ----- echo ----- Downloading body pose (COCO and MPI), face and hand models -----
SET WGET_EXE=..\3rdparty\windows\wget\wget.exe SET WGET_EXE=..\3rdparty\windows\wget\wget.exe
SET OPENPOSE_URL=http://posefs1.perception.cs.cmu.edu/OpenPose/models/ SET OPENPOSE_URL=http://posefs1.perception.cs.cmu.edu/OpenPose/models/
...@@ -10,7 +10,7 @@ SET FACE_FOLDER=face/ ...@@ -10,7 +10,7 @@ SET FACE_FOLDER=face/
SET HAND_FOLDER=hand/ SET HAND_FOLDER=hand/
echo: echo:
echo ------------------------- POSE MODELS ------------------------- echo ------------------------- POSE (BODY+FOOT) MODELS -------------------------
echo Body (BODY_25) echo Body (BODY_25)
set BODY_25_FOLDER=%POSE_FOLDER%body_25/ set BODY_25_FOLDER=%POSE_FOLDER%body_25/
set BODY_25_MODEL=%BODY_25_FOLDER%pose_iter_584000.caffemodel set BODY_25_MODEL=%BODY_25_FOLDER%pose_iter_584000.caffemodel
......
# ------------------------- BODY, FACE AND HAND MODELS ------------------------- # ------------------------- BODY, FOOT, FACE, AND HAND MODELS -------------------------
# Downloading body pose (COCO and MPI), face and hand models # Downloading body pose (COCO and MPI), face and hand models
OPENPOSE_URL="http://posefs1.perception.cs.cmu.edu/OpenPose/models/" OPENPOSE_URL="http://posefs1.perception.cs.cmu.edu/OpenPose/models/"
POSE_FOLDER="pose/" POSE_FOLDER="pose/"
FACE_FOLDER="face/" FACE_FOLDER="face/"
HAND_FOLDER="hand/" HAND_FOLDER="hand/"
# ------------------------- POSE MODELS ------------------------- # ------------------------- POSE (BODY+FOOT) MODELS -------------------------
# Body (BODY_25) # Body (BODY_25)
BODY_25_FOLDER=${POSE_FOLDER}"body_25/" BODY_25_FOLDER=${POSE_FOLDER}"body_25/"
BODY_25_MODEL=${BODY_25_FOLDER}"pose_iter_584000.caffemodel" BODY_25_MODEL=${BODY_25_FOLDER}"pose_iter_584000.caffemodel"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# sudo apt-get install graphviz # sudo apt-get install graphviz
# USAGE EXAMPLE # 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 # # Go back to main folder
# cd ../../ # cd ../../
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# Step 1 - Getting JSON output # Step 1 - Getting JSON output
# Running it: # Running it:
# Run it from OpenPose main folder with the following command: # 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: # Image paths:
# Read that script for details about all the paths and change them for your own paths. # Read that script for details about all the paths and change them for your own paths.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
clear && clear clear && clear
# USAGE EXAMPLE # 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 # # Go back to main folder
# cd ../../ # cd ../../
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# USAGE EXAMPLE # 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. # Script for internal use. We might completely change it continuously and we will not answer questions about it.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# USAGE EXAMPLE # 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. # Script for internal use. We might completely change it continuously and we will not answer questions about it.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
clear && clear clear && clear
# USAGE EXAMPLE # USAGE EXAMPLE
# See ./examples/tests/pose_accuracy_coco_test.sh # See ./scripts/tests/pose_accuracy_coco_test.sh
# Parameters # Parameters
IMAGE_FOLDER=/home/gines/devel/images/val2017/ IMAGE_FOLDER=/home/gines/devel/images/val2017/
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# cd ../../ # cd ../../
# Re-build # Re-build
clear && clear && make all -j12 clear && clear && make all -j`nproc`
# Performance results (~1400) # Performance results (~1400)
./build/examples/openpose/openpose.bin --video soccer.mp4 --frame_last 1500 ./build/examples/openpose/openpose.bin --video soccer.mp4 --frame_last 1500
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Script for internal use. We might completely change it continuously and we will not answer questions about it. # Script for internal use. We might completely change it continuously and we will not answer questions about it.
# USAGE EXAMPLE # 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 # # Go back to main folder
# cd ../../ # cd ../../
......
#!/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
#!/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
#!/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
#!/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}."
#!/bin/bash
# Install dependencies for Mac OSX
echo "Running on Mac OSX."
echo "Mac OSX version not implemented for Travis Build testing."
exit 99
#!/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
#!/bin/bash #!/bin/bash
# build the project
# Build the project
BASEDIR=$(dirname $0) BASEDIR=$(dirname $0)
source $BASEDIR/defaults.sh source $BASEDIR/defaults.sh
if $WITH_CMAKE ; then if [[ $WITH_CMAKE == true ]] ; then
cd build cd build
make -j`nproc` make -j`nproc`
# make --jobs $NUM_THREADS else
else # if ! $WITH_CMAKE ; then
make all -j`nproc` make all -j`nproc`
# make --jobs $NUM_THREADS all
fi fi
#!/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
...@@ -26,15 +26,6 @@ echo "" ...@@ -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 -------------------------" echo "------------------------- Installing some Caffe Dependencies -------------------------"
# Basic # Basic
sudo apt-get --assume-yes update sudo apt-get --assume-yes update
...@@ -56,9 +47,9 @@ echo "" ...@@ -56,9 +47,9 @@ echo ""
echo "------------------------- Compiling Caffe -------------------------" echo "------------------------- Compiling Caffe -------------------------"
cp Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe Makefile.config cp Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe Makefile.config
make all -j$NUM_CORES && make distribute -j$NUM_CORES make all -j`nproc` && make distribute -j`nproc`
# make test -j$NUM_CORES # make test -j`nproc`
# make runtest -j$NUM_CORES # make runtest -j`nproc`
exitIfError exitIfError
echo "------------------------- Caffe Compiled -------------------------" echo "------------------------- Caffe Compiled -------------------------"
echo "" echo ""
......
...@@ -41,7 +41,7 @@ exitIfError ...@@ -41,7 +41,7 @@ exitIfError
executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./3rdparty/ubuntu/" "./" executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./scripts/ubuntu/" "./"
exitIfError exitIfError
......
...@@ -36,14 +36,14 @@ function executeShInItsFolder { ...@@ -36,14 +36,14 @@ function executeShInItsFolder {
rm -r ./3rdparty/caffe rm -r ./3rdparty/caffe
git submodule update --init --recursive git submodule update --init --recursive
mv ./3rdparty/ubuntu/install_caffe_JetsonTX2_JetPack3.3.sh ./3rdparty/caffe/install_caffe_JetsonTX2_JetPack3.3.sh mv ./scripts/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/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe ./3rdparty/caffe/Makefile.config.Ubuntu16_cuda9_JetsonTX2_caffe
executeShInItsFolder "install_caffe_JetsonTX2_JetPack3.3.sh" "./3rdparty/caffe" "../.." executeShInItsFolder "install_caffe_JetsonTX2_JetPack3.3.sh" "./3rdparty/caffe" "../.."
exitIfError exitIfError
executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.3.sh" "./3rdparty/ubuntu/" "./" executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.3.sh" "./scripts/ubuntu/" "./"
exitIfError exitIfError
......
...@@ -25,7 +25,7 @@ function executeShInItsFolder { ...@@ -25,7 +25,7 @@ function executeShInItsFolder {
exitIfError exitIfError
sudo chmod +x $1 sudo chmod +x $1
exitIfError exitIfError
./$1 bash ./$1
exitIfError exitIfError
cd $3 cd $3
exitIfError exitIfError
...@@ -40,23 +40,14 @@ echo "" ...@@ -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 -------------------------" echo "------------------------- Compiling OpenPose -------------------------"
# Go back to main folder # Go back to main folder
cd ../.. cd ../..
# Copy Makefile & Makefile.config # Copy Makefile & Makefile.config
cp 3rdparty/ubuntu/Makefile.example Makefile cp scripts/ubuntu/Makefile.example Makefile
cp 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 Makefile.config cp scripts/ubuntu/Makefile.config.Ubuntu16_cuda8_JetsonTX2 Makefile.config
# Compile OpenPose # Compile OpenPose
make all -j$NUM_CORES make all -j`nproc`
exitIfError exitIfError
echo "------------------------- OpenPose Compiled -------------------------" echo "------------------------- OpenPose Compiled -------------------------"
echo "" echo ""
......
...@@ -25,7 +25,7 @@ function executeShInItsFolder { ...@@ -25,7 +25,7 @@ function executeShInItsFolder {
exitIfError exitIfError
sudo chmod +x $1 sudo chmod +x $1
exitIfError exitIfError
./$1 bash ./$1
exitIfError exitIfError
cd $3 cd $3
exitIfError exitIfError
...@@ -40,23 +40,14 @@ echo "" ...@@ -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 -------------------------" echo "------------------------- Compiling OpenPose -------------------------"
# Go back to main folder # Go back to main folder
cd ../.. cd ../..
# Copy Makefile & Makefile.config # Copy Makefile & Makefile.config
cp 3rdparty/ubuntu/Makefile.example_openpose Makefile cp scripts/ubuntu/Makefile.example_openpose Makefile
cp 3rdparty/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose Makefile.config cp scripts/ubuntu/Makefile.config.Ubuntu16_cuda9_JetsonTX2_openpose Makefile.config
# Compile OpenPose # Compile OpenPose
make all -j$NUM_CORES make all -j`nproc`
exitIfError exitIfError
echo "------------------------- OpenPose Compiled -------------------------" echo "------------------------- OpenPose Compiled -------------------------"
echo "" echo ""
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
### INSTALL PREREQUISITES ### INSTALL PREREQUISITES
# Install CUDA 8.0 # Install CUDA 8.0
bash 3rdparty/ubuntu/install_cuda.sh bash scripts/ubuntu/install_cuda.sh
# Install cuDNN 5.1 # Install cuDNN 5.1
bash 3rdparty/ubuntu/install_cudnn.sh bash scripts/ubuntu/install_cudnn.sh
# Caffe prerequisites # Caffe prerequisites
bash 3rdparty/ubuntu/install_ubuntu_deps.sh bash scripts/ubuntu/install_ubuntu_deps.sh
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
echo "------------------------- Installing OpenPose -------------------------" echo "------------------------- Preprocessing -------------------------"
echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail." echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail."
...@@ -19,22 +19,6 @@ function exitIfError { ...@@ -19,22 +19,6 @@ function exitIfError {
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 -------------------------" echo "------------------------- Checking Ubuntu Version -------------------------"
ubuntu_version="$(lsb_release -r)" ubuntu_version="$(lsb_release -r)"
echo "Ubuntu $ubuntu_version" echo "Ubuntu $ubuntu_version"
...@@ -52,41 +36,18 @@ echo "" ...@@ -52,41 +36,18 @@ echo ""
echo "------------------------- Checking Number of Processors -------------------------" echo "------------------------- Copying Required Files -------------------------"
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 # Copy Makefile & Makefile.config
cp 3rdparty/ubuntu/Makefile.example Makefile cp scripts/ubuntu/Makefile.example Makefile
if [[ $ubuntu_le_14 == true ]]; then if [[ $ubuntu_le_14 == true ]]; then
cp 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example Makefile.config cp scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda8.example Makefile.config
else else
cp 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example Makefile.config cp scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example Makefile.config
fi fi
# Compile OpenPose
make all -j$NUM_CORES
exitIfError exitIfError
echo "------------------------- OpenPose Compiled -------------------------" echo "------------------------- Required Files Copied -------------------------"
echo ""
echo "------------------------- Downloading OpenPose Models -------------------------"
executeShInItsFolder "getModels.sh" "./models" ".."
exitIfError
echo "Models downloaded"
echo "------------------------- OpenPose Models Downloaded -------------------------"
echo ""
echo "------------------------- OpenPose Installed -------------------------" echo "------------------------- Preprocessing Ready -------------------------"
echo "" echo ""
...@@ -41,7 +41,7 @@ exitIfError ...@@ -41,7 +41,7 @@ exitIfError
executeShInItsFolder "install_openpose_if_cuda8.sh" "./3rdparty/ubuntu_deprecated/" "./" executeShInItsFolder "install_openpose_if_cuda8.sh" "./scripts/ubuntu_deprecated/" "./"
exitIfError exitIfError
......
#!/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 ""
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册