提交 dabd713b 编写于 作者: G gineshidalgo99

Added doc and removed upImpl in poseExtractor

上级 99855c6a
......@@ -22,6 +22,11 @@ matrix:
# 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
# Ubuntu 16.04 - Python - CMake - CUDA
- os: linux
dist: xenial
......@@ -37,15 +42,10 @@ matrix:
dist: xenial
env: NAME="U16-python-cmake-cpu" WITH_PYTHON=true WITH_CUDA=false
sudo: required
# Ubuntu 16.04 - Default - CMake - CUDA
# Ubuntu 16.04 - Python - CMake - OpenCL
- os: linux
dist: xenial
env: NAME="U16-default-cmake-cuda8"
sudo: required
# Ubuntu 16.04 - Default - CMake - CPU
- os: linux
dist: xenial
env: NAME="U16-default-cmake-cpu" WITH_CUDA=false
env: NAME="U16-python-cmake-opencl" WITH_PYTHON=true WITH_CUDA=false WITH_OPEN_CL=true
sudo: required
# Ubuntu 16.04 - Python - CMake - CPU - Debug
- os: linux
......@@ -64,10 +64,10 @@ matrix:
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
sudo: required
# Mac OSX - Default - CMake - CPU
# Mac OSX - Python - CMake - OpenCL
- 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
env: NAME="OSX-default-cmake-opencl" WITH_CUDA=false WITH_OPEN_CL=true
sudo: required
# Mac OSX - Python - CMake - CPU - Debug
- os: osx
......@@ -79,10 +79,10 @@ matrix:
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
# Mac OSX - Default - CMake - OpenCL
# 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-opencl" WITH_CUDA=false WITH_OPEN_CL=true
env: NAME="OSX-default-cmake-cpu" WITH_CUDA=false
sudo: required
# # TO-DO: To be implemented
......@@ -92,6 +92,11 @@ matrix:
# env: NAME="W10-default-cmake-cuda8"
# Ubuntu (others)
# 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 - Make - CUDA
- os: linux
dist: xenial
......@@ -103,11 +108,6 @@ matrix:
# dist: xenial
# env: NAME="U16-default-cmake-cpu-mkl" WITH_CUDA=false WITH_MKL=true
# 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
......
......@@ -4,10 +4,10 @@
-----------------
| |`Python (CUDA)`| `Python (CPU)`| `CUDA` | `CPU` | `Debug` | `Unity` |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| |`Default Config` |`CUDA (+Python)` |`CPU (+Python)` |`OpenCL (+Python)`| `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) |
| **`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/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) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/11)](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)
......
......@@ -107,7 +107,7 @@ Examples:
1. **VERY IMPORTANT NOTE**: If you want to re-run the extrinsic parameter calibration over the same intrinsic XML files (e.g., if you move the camera location, but you know the instrinsics are the same), you must manually re-set to `1 0 0 0 0 1 0 0 0 0 1 0` the camera matrix of each XML file that will be used for `--combine_cam0_extrinsics`.
2. After intrinsics calibration, save undirtoted images for all the camera views:
```sh
./build/examples/openpose/openpose.bin --num_gpu 0 --flir_camera --write_images ~/Desktop/extrinsics
./build/examples/openpose/openpose.bin --num_gpu 0 --flir_camera --frame_undistort --write_images ~/Desktop/extrinsics
```
3. Run the extrinsic calibration tool between each pair of close cameras. In this example:
- We assume camera 0 to the right, 1 in the middle-right, 2 in the middle-left, and 3 in the left.
......@@ -151,3 +151,28 @@ Examples:
If you plan to use the calibration tool without using OpenPose, you can manually save a video sequence of your desired camera into each of the camera image folders (i.e., in the above example, the `~/Desktop/intrinsics_0`, `~/Desktop/intrinsics_1`, etc. folders).
If you wanna eventually run that camera with OpenPose, check [doc/modules/3d_reconstruction_module.md#using-a-different-camera-brand](./modules/3d_reconstruction_module.md#using-a-different-camera-brand).
## Naming Convention for the Output Images
The naming convention for the saved images is the following: `[%12d]_rendered[CAMERA_NUMBER_MINUS_1].png`, where `[CAMERA_NUMBER_MINUS_1]` is nothing for camera 0, `_1` for camera 1, `_2` for camera 2, etc. E.g., for 4 cameras:
```
000000000000_rendered.png
000000000000_rendered_1.png
000000000000_rendered_2.png
000000000000_rendered_3.png
000000000001_rendered.png
000000000001_rendered_1.png
000000000001_rendered_2.png
000000000001_rendered_3.png
[...]
```
OpenPose generates them with the base name `[%12d]_rendered`. Ideally, any other base number should work as long as the termination `[CAMERA_NUMBER_MINUS_1]` is kept consistent for all the camera views. E.g., you could call them also as follows (assuming 4 cameras):
```
a.png, a_1.png, a_2.png, a_3.png,
b.png, b_1.png, b_2.png, b_3.png,
etc.
```
Again, the critical step is to keep the file termination fixed as `_1`, `_2`, etc.
......@@ -13,6 +13,12 @@
## Introduction
This module exposes a Python API for OpenPose. It is effectively a wrapper that replicates most of the functionality of the [op::Wrapper class](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/include/openpose/wrapper/wrapper.hpp) and allows you to populate and retrieve data from the [op::Datum class](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/include/openpose/core/datum.hpp) using standard Python and Numpy constructs.
The Python API is analagous to the C++ function calls. You may find them in [python/openpose/openpose_python.cpp#L194](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/python/openpose/openpose_python.cpp#L194).
The Python API is rather simple: `op::Array<float>` and `cv::Mat` objects get casted to numpy arrays automatically. Every other data structure based on the standard library is automatically converted into Python objects. For example, an `std::vector<std::vector<float>>` would become `[[item, item], [item, item]]`, etc. We also provide a casting of `op::Rectangle` and `op::Point` which simply expose setter getter for [x, y, width, height], etc.
## Compatibility
......
......@@ -2,6 +2,12 @@
#define OPENPOSE_POSE_POSE_EXTRACTOR_CAFFE_HPP
#include <openpose/core/common.hpp>
#include <openpose/net/bodyPartConnectorCaffe.hpp>
#include <openpose/net/maximumCaffe.hpp>
#include <openpose/net/netCaffe.hpp>
#include <openpose/net/netOpenCv.hpp>
#include <openpose/net/nmsCaffe.hpp>
#include <openpose/net/resizeAndMergeCaffe.hpp>
#include <openpose/pose/enumClasses.hpp>
#include <openpose/pose/poseExtractorNet.hpp>
......@@ -21,7 +27,7 @@ namespace op
virtual ~PoseExtractorCaffe();
void netInitializationOnThread();
virtual void netInitializationOnThread();
/**
* @param poseNetOutput If it is not empty, OpenPose will not run its internal body pose estimation network
......@@ -30,7 +36,7 @@ namespace op
* modify the pose estimation flags to match the dimension of both elements (e.g., `--net_resolution`,
* `--scale_number`, etc.).
*/
void forwardPass(
virtual void forwardPass(
const std::vector<Array<float>>& inputNetData, const Point<int>& inputDataSize,
const std::vector<double>& scaleInputToNetInputs = {1.f},
const Array<float>& poseNetOutput = Array<float>{});
......@@ -48,13 +54,28 @@ namespace op
const float* getPoseGpuConstPtr() const;
private:
// PIMPL idiom
// http://www.cppsamples.com/common-tasks/pimpl.html
struct ImplPoseExtractorCaffe;
std::unique_ptr<ImplPoseExtractorCaffe> upImpl;
// Used when increasing spNets
const PoseModel mPoseModel;
const int mGpuId;
const std::string mModelFolder;
const std::string mProtoTxtPath;
const std::string mCaffeModelPath;
const float mUpsamplingRatio;
const bool mEnableNet;
const bool mEnableGoogleLogging;
// General parameters
std::vector<std::shared_ptr<Net>> spNets;
std::shared_ptr<ResizeAndMergeCaffe<float>> spResizeAndMergeCaffe;
std::shared_ptr<NmsCaffe<float>> spNmsCaffe;
std::shared_ptr<BodyPartConnectorCaffe<float>> spBodyPartConnectorCaffe;
std::shared_ptr<MaximumCaffe<float>> spMaximumCaffe;
std::vector<std::vector<int>> mNetInput4DSizes;
// Init with thread
std::vector<std::shared_ptr<ArrayCpuGpu<float>>> spCaffeNetOutputBlobs;
std::shared_ptr<ArrayCpuGpu<float>> spHeatMapsBlob;
std::shared_ptr<ArrayCpuGpu<float>> spPeaksBlob;
std::shared_ptr<ArrayCpuGpu<float>> spMaximumPeaksBlob;
// PIMP requires DELETE_COPY & destructor, or extra code
// http://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html
DELETE_COPY(PoseExtractorCaffe);
};
}
......
......@@ -2,6 +2,7 @@
# Set default environment variables
set -e
TRAVIS_OS_NAME=${TRAVIS_OS_NAME}
WITH_CMAKE=${WITH_CMAKE:-true}
WITH_PYTHON=${WITH_PYTHON:-false}
WITH_CUDA=${WITH_CUDA:-true}
......@@ -10,7 +11,6 @@ WITH_OPEN_CL=${WITH_OPEN_CL:-false}
WITH_MKL=${WITH_MKL:-false}
WITH_UNITY=${WITH_UNITY:-false}
WITH_DEBUG=${WITH_DEBUG:-false}
TRAVIS_OS_NAME=${TRAVIS_OS_NAME}
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册