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

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

上级 5c6072b4
......@@ -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/<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
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/<user_name>/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
:: 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)
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=<INSTALL_DIR>
-DMKLDNN_INSTALL_DIR:PATH=<INSTALL_DIR>
-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=<INSTALL_DIR>
-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
......
# 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
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.
......@@ -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:
......
......@@ -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).
......
......@@ -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
```
......
......@@ -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
```
......
......@@ -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.
......
# 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**.
......@@ -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/flags.hpp>
// OpenPose dependencies
#include <openpose/headers.hpp>
......
:: 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
......
# ------------------------- 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"
......
......@@ -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 ../../
......
......@@ -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.
......
......@@ -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 ../../
......
......@@ -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.
......
......@@ -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.
......
......@@ -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/
......
......@@ -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
......
......@@ -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 ../../
......
#!/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
# build the project
# Build the project
BASEDIR=$(dirname $0)
source $BASEDIR/defaults.sh
if $WITH_CMAKE ; then
if [[ $WITH_CMAKE == true ]] ; then
cd build
make -j`nproc`
# make --jobs $NUM_THREADS
else # if ! $WITH_CMAKE ; then
else
make all -j`nproc`
# make --jobs $NUM_THREADS all
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 ""
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 ""
......
......@@ -41,7 +41,7 @@ exitIfError
executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./3rdparty/ubuntu/" "./"
executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./scripts/ubuntu/" "./"
exitIfError
......
......@@ -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
......
......@@ -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 ""
......
......@@ -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 ""
......
......@@ -3,10 +3,10 @@
### INSTALL PREREQUISITES
# Install CUDA 8.0
bash 3rdparty/ubuntu/install_cuda.sh
bash scripts/ubuntu/install_cuda.sh
# Install cuDNN 5.1
bash 3rdparty/ubuntu/install_cudnn.sh
bash scripts/ubuntu/install_cudnn.sh
# Caffe prerequisites
bash 3rdparty/ubuntu/install_ubuntu_deps.sh
bash scripts/ubuntu/install_ubuntu_deps.sh
......@@ -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."
......@@ -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 -------------------------"
ubuntu_version="$(lsb_release -r)"
echo "Ubuntu $ubuntu_version"
......@@ -52,41 +36,18 @@ 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 ../..
echo "------------------------- Copying Required Files -------------------------"
# Copy Makefile & Makefile.config
cp 3rdparty/ubuntu/Makefile.example Makefile
cp scripts/ubuntu/Makefile.example Makefile
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
cp 3rdparty/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example Makefile.config
cp scripts/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 "------------------------- Required Files Copied -------------------------"
echo "------------------------- OpenPose Installed -------------------------"
echo "------------------------- Preprocessing Ready -------------------------"
echo ""
......@@ -41,7 +41,7 @@ exitIfError
executeShInItsFolder "install_openpose_if_cuda8.sh" "./3rdparty/ubuntu_deprecated/" "./"
executeShInItsFolder "install_openpose_if_cuda8.sh" "./scripts/ubuntu_deprecated/" "./"
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.
先完成此消息的编辑!
想要评论请 注册