Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gineshidalgo99 committed Feb 8, 2019
1 parent de11748 commit babd890
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 174 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ matrix:
dist: xenial
env: NAME="U16-python-cmake-cpu-debug" WITH_PYTHON=true WITH_CUDA=false WITH_DEBUG=true
sudo: required
# Ubuntu 16.04 - Python - CMake - CPU - Unity
- os: linux
dist: xenial
env: NAME="U16-python-cmake-cpu-unity" WITH_PYTHON=true WITH_UNITY=true WITH_CUDA=false
sudo: required

# Mac OSX
# Mac OSX - Python - CMake - CPU
Expand All @@ -67,7 +72,12 @@ matrix:
# Mac OSX - Python - CMake - CPU - Debug
- os: osx
osx_image: xcode9.4 # xcode10.1 does not work with Python # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
env: NAME="OSX-python-cmake-cpu" WITH_CUDA=false WITH_PYTHON=true WITH_DEBUG=true
env: NAME="OSX-python-cmake-cpu-debug" WITH_CUDA=false WITH_PYTHON=true WITH_DEBUG=true
sudo: required
# Mac OSX - Python - CMake - CPU - Unity
- os: osx
osx_image: xcode9.4 # xcode10.1 does not work with Python # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
env: NAME="OSX-python-cmake-cpu-unity" WITH_CUDA=false WITH_PYTHON=true WITH_UNITY=true
sudo: required

# # TO-DO: To be implemented
Expand Down
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ if (WIN32)
endif (WIN32)

# Unity
if (WIN32)
option(BUILD_UNITY_SUPPORT "Build OpenPose as a Unity plugin." OFF)
endif (WIN32)
option(BUILD_UNITY_SUPPORT "Build OpenPose as a Unity plugin." OFF)

# Build as shared library
option(BUILD_SHARED_LIBS "Build as shared lib." ON)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

-----------------

| | `Python (CUDA GPU)` | `Python (CPU)` | `CUDA GPU` | `CPU` | `Debug mode` |
| :---: | :---: | :---: | :---: |:---: | :---: |
| **`Linux`** | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/1)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/2)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/3)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/4)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/5)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) |
| **`MacOS`** | | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/6)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/7)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/8)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) |
<!-- | **`Windows`** | | | | | | -->
| |`Python (CUDA)`| `Python (CPU)`| `CUDA` | `CPU` | `Debug` | `Unity` |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| **`Linux`** | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/1)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/2)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/3)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/4)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/5)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/6)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) |
| **`MacOS`** | | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/7)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/8)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/9)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/10)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) |
<!-- | **`Windows`** | | | | | | -->
<!--
Note: Currently using [travis-matrix-badges](https://github.com/bjfish/travis-matrix-badges) vs. traditional [![Build Status](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose.svg?branch=master)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose)
-->
Expand Down
2 changes: 1 addition & 1 deletion include/openpose/core/arrayCpuGpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace op

const T* cpu_data() const;
void set_cpu_data(T* data);
const int* gpu_shape() const;
// const int* gpu_shape() const; // Disabled because it produces compiler errors for some users
const T* gpu_data() const;
void set_gpu_data(T* data);
const T* cpu_diff() const;
Expand Down
5 changes: 5 additions & 0 deletions scripts/travis/configure_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ else
ARGS="$ARGS -DUSE_CUDNN=Off"
fi

echo "WITH_UNITY = ${WITH_UNITY}."
if [[ $WITH_UNITY == true ]] ; then
ARGS="$ARGS -DBUILD_UNITY_SUPPORT=On"
fi

echo "WITH_DEBUG = ${WITH_DEBUG}."
if [[ $WITH_DEBUG == true ]] ; then
ARGS="$ARGS -DCMAKE_BUILD_TYPE=Debug"
Expand Down
5 changes: 3 additions & 2 deletions scripts/travis/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ WITH_CUDA=${WITH_CUDA:-true}
WITH_CUDNN=${WITH_CUDNN:-true}
WITH_OPEN_CL=${WITH_OPEN_CL:-false}
WITH_MKL=${WITH_MKL:-false}
WITH_UNITY=${WITH_UNITY:-false}
WITH_DEBUG=${WITH_DEBUG:-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
if [[ $WITH_CUDA == false ]] && [[ $WITH_OPEN_CL == false ]] && [[ $WITH_UNITY == false ]]; then
RUN_EXAMPLES=true
else
RUN_EXAMPLES=false
Expand All @@ -21,7 +22,7 @@ echo "RUN_EXAMPLES = ${RUN_EXAMPLES}."

# Makefile configuration compatible
# if [[ $WITH_PYTHON == false ]] ; then
if [[ $WITH_PYTHON == false ]] && [[ $WITH_DEBUG == false ]]; then
if [[ $WITH_PYTHON == false ]] && [[ $WITH_DEBUG == false ]] && [[ $WITH_UNITY == false ]]; then
MAKE_CONFIG_COMPATIBLE=true
else
MAKE_CONFIG_COMPATIBLE=false
Expand Down
34 changes: 17 additions & 17 deletions src/openpose/core/arrayCpuGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,23 +578,23 @@ namespace op
}
}

template<typename T>
const int* ArrayCpuGpu<T>::gpu_shape() const
{
try
{
#ifdef USE_CAFFE
return spImpl->pCaffeBlobT->gpu_shape();
#else
return nullptr;
#endif
}
catch (const std::exception& e)
{
error(e.what(), __LINE__, __FUNCTION__, __FILE__);
return nullptr;
}
}
// template<typename T>
// const int* ArrayCpuGpu<T>::gpu_shape() const
// {
// try
// {
// #ifdef USE_CAFFE
// return spImpl->pCaffeBlobT->gpu_shape();
// #else
// return nullptr;
// #endif
// }
// catch (const std::exception& e)
// {
// error(e.what(), __LINE__, __FUNCTION__, __FILE__);
// return nullptr;
// }
// }

template<typename T>
const T* ArrayCpuGpu<T>::gpu_data() const
Expand Down
5 changes: 3 additions & 2 deletions src/openpose/pose/poseExtractorCaffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ namespace op
{
// Sanity check
if (inputNetData.size() != 1u)
error("Size(inputNetData) must be provided heatmaps (" + std::to_string(inputNetData.size())
+ " vs. " + std::to_string(1) + ").", __LINE__, __FUNCTION__, __FILE__);
error("Size(inputNetData) must match the provided heatmaps batch size ("
+ std::to_string(inputNetData.size()) + " vs. " + std::to_string(1) + ").",
__LINE__, __FUNCTION__, __FILE__);
// Copy heatmap information
upImpl->spCaffeNetOutputBlobs.clear();
const bool copyFromGpu = false;
Expand Down
Loading

0 comments on commit babd890

Please sign in to comment.