提交 babd8900 编写于 作者: G gineshidalgo99

Fixed #1069 and #1071

上级 de117486
......@@ -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
......@@ -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
......
......@@ -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)
......
......@@ -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)
-->
......
......@@ -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;
......
......@@ -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"
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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;
......
此差异已折叠。
......@@ -9,21 +9,36 @@ namespace op
#ifdef USE_UNITY_SUPPORT
namespace UnityDebugger
{
typedef void(__stdcall * DebugCallback) (const char* const str, int type);
DebugCallback unityDebugCallback;
bool unityDebugEnabled = true;
#ifdef _WIN32
typedef void(__stdcall * DebugCallback) (const char* const str, int type);
DebugCallback unityDebugCallback;
#endif
bool unityDebugEnabled = true;
extern "C" void OP_API _OPRegisterDebugCallback(DebugCallback debugCallback) {
if (debugCallback)
#ifdef _WIN32
extern "C" void OP_API _OPRegisterDebugCallback(DebugCallback debugCallback)
{
if (debugCallback)
unityDebugCallback = debugCallback;
}
}
extern "C" void OP_API _OPSetDebugEnable(bool enable) {
unityDebugEnabled = enable;
}
extern "C" void OP_API _OPSetDebugEnable(bool enable)
{
unityDebugEnabled = enable;
}
#endif
void DebugInUnity(const std::string& message, const int type) {
if (unityDebugEnabled) if (unityDebugCallback) unityDebugCallback(message.c_str(), type);
void DebugInUnity(const std::string& message, const int type)
{
#ifdef _WIN32
if (unityDebugEnabled)
if (unityDebugCallback)
unityDebugCallback(message.c_str(), type);
#else
UNUSED(message);
UNUSED(type);
error("Unity plugin only available on Windows.", __LINE__, __FUNCTION__, __FILE__);
#endif
}
void log(const std::string& message) { DebugInUnity(message, 0); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册