Skip to content

Commit

Permalink
Circular PAF properly handled
Browse files Browse the repository at this point in the history
  • Loading branch information
gineshidalgo99 committed Sep 21, 2018
1 parent a6bcf83 commit c03fbda
Show file tree
Hide file tree
Showing 9 changed files with 886 additions and 697 deletions.
2 changes: 1 addition & 1 deletion doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ By default, the body COCO and MPI models are not downloaded. You can download th


#### Python API
To install the Python API, ensure that the `BUILD_PYTHON` flag is turned on while running CMake GUI. Check [doc/modules/python_module.md](./modules/python_module.md) for further details.
To install the Python API, ensure that the `BUILD_PYTHON` flag is turned on while running CMake GUI and follow the standard installation steps. After the installation, check [doc/modules/python_module.md](./modules/python_module.md) for further details.



Expand Down
2 changes: 1 addition & 1 deletion doc/modules/python_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The OpenPose Python module is compatible with both Python 2 and Python 3. In add


## Installation
Check [doc/installation.md#python-module](./installation.md#python-module) for installation steps.
Check [doc/installation.md#python-module](../installation.md#python-api) for installation steps.

The Python API requires Numpy for array management, and OpenCV for image loading. They can be installed via:

Expand Down
2 changes: 1 addition & 1 deletion doc/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ OpenPose Library - Release Notes
## Current version - future OpenPose 1.4.1
1. Main improvements:
1. Added initial single-person tracker for further speed up or visual smoothing (`--tracking` flag).
2. Greedy body part connector implemented in CUDA: +~33% speed up in Nvidia (CUDA) version with default flags and +~10% in maximum accuracy configuration.
2. Greedy body part connector implemented in CUDA: +~30% speed up in Nvidia (CUDA) version with default flags and +~10% in maximum accuracy configuration. In addition, it provides a small 0.2% boost in accuracy (default flags).
3. OpenPose can be built as Unity plugin: Added flag `BUILD_UNITY_SUPPORT` and special Unity code.
2. Functions or parameters renamed:
1. By default, python example `2_pose_from_heatmaps.py` was using 2 scales starting at -1x736, changed to 1 scale at -1x368.
Expand Down
35 changes: 22 additions & 13 deletions include/openpose/pose/bodyPartConnectorBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,41 @@ namespace op
const T* const peaksPtr, const PoseModel poseModel, const Point<int>& heatMapSize,
const int maxPeaks, const T interMinAboveThreshold, const T interThreshold,
const int minSubsetCnt, const T minSubsetScore, const T scaleFactor = 1.f,
Array<T> finalOutputCpu = Array<T>{}, T* finalOutputGpuPtr = nullptr,
Array<T> pairScoresCpu = Array<T>{}, T* pairScoresGpuPtr = nullptr,
const unsigned int* const bodyPartPairsGpuPtr = nullptr,
const unsigned int* const mapIdxGpuPtr = nullptr,
const T* const peaksGpuPtr = nullptr);

// Private functions used by the 2 above functions
template <typename T>
OP_API std::vector<std::pair<std::vector<int>, double>> generateInitialSubsets(
OP_API std::vector<std::pair<std::vector<int>, T>> createPeopleVector(
const T* const heatMapPtr, const T* const peaksPtr, const PoseModel poseModel, const Point<int>& heatMapSize,
const int maxPeaks, const T interThreshold, const T interMinAboveThreshold,
const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyParts,
const unsigned int numberBodyPartPairs, const unsigned int subsetCounterIndex,
const Array<T>& precomputedPAFs = Array<T>());
const unsigned int numberBodyPartPairs, const Array<T>& precomputedPAFs = Array<T>());

template <typename T>
OP_API void removeSubsetsBelowThresholds(std::vector<int>& validSubsetIndexes, int& numberPeople,
const std::vector<std::pair<std::vector<int>, double>>& subsets,
const unsigned int subsetCounterIndex, const unsigned int numberBodyParts,
const int minSubsetCnt, const T minSubsetScore, const int maxPeaks);
OP_API void removePeopleBelowThresholds(std::vector<int>& validSubsetIndexes, int& numberPeople,
const std::vector<std::pair<std::vector<int>, T>>& subsets,
const unsigned int numberBodyParts, const int minSubsetCnt,
const T minSubsetScore, const int maxPeaks);

template <typename T>
OP_API void subsetsToPoseKeypointsAndScores(Array<T>& poseKeypoints, Array<T>& poseScores, const T scaleFactor,
const std::vector<std::pair<std::vector<int>, double>>& subsets,
const std::vector<int>& validSubsetIndexes, const T* const peaksPtr,
const int numberPeople, const unsigned int numberBodyParts,
const unsigned int numberBodyPartPairs);
OP_API void peopleVectorToPeopleArray(Array<T>& poseKeypoints, Array<T>& poseScores, const T scaleFactor,
const std::vector<std::pair<std::vector<int>, T>>& subsets,
const std::vector<int>& validSubsetIndexes, const T* const peaksPtr,
const int numberPeople, const unsigned int numberBodyParts,
const unsigned int numberBodyPartPairs);

template <typename T>
OP_API std::vector<std::tuple<T, T, int, int, int>> pafPtrIntoVector(
const Array<T>& pairScores, const T* const peaksPtr, const int maxPeaks,
const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyPartPairs);

template <typename T>
OP_API std::vector<std::pair<std::vector<int>, T>> pafVectorIntoPeopleVector(
const std::vector<std::tuple<T, T, int, int, int>>& pairScores, const T* const peaksPtr, const int maxPeaks,
const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyParts);
}

#endif // OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP
1 change: 0 additions & 1 deletion include/openpose/pose/poseParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace op
OP_API unsigned int getPoseNumberBodyParts(const PoseModel poseModel);
OP_API const std::vector<unsigned int>& getPosePartPairs(const PoseModel poseModel);
OP_API const std::vector<unsigned int>& getPoseMapIndex(const PoseModel poseModel);
OP_API const std::vector<int>& getPosePartPairsStar(const PoseModel poseModel);
OP_API unsigned int getPoseMaxPeaks(const PoseModel poseModel);
OP_API float getPoseNetDecreaseFactor(const PoseModel poseModel);
OP_API unsigned int poseBodyPartMapStringToKey(const PoseModel poseModel, const std::string& string);
Expand Down
Loading

0 comments on commit c03fbda

Please sign in to comment.