OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bodyPartConnectorBase.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP
2 #define OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP
3 
6 
7 namespace op
8 {
9  template <typename T>
11  Array<T>& poseKeypoints, Array<T>& poseScores, const T* const heatMapPtr, const T* const peaksPtr,
12  const PoseModel poseModel, const Point<int>& heatMapSize, const int maxPeaks, const T interMinAboveThreshold,
13  const T interThreshold, const int minSubsetCnt, const T minSubsetScore, const T scaleFactor = 1.f);
14 
15  // Windows: Cuda functions do not include OP_API
16  template <typename T>
18  Array<T>& poseKeypoints, Array<T>& poseScores, const T* const heatMapGpuPtr, const T* const peaksPtr,
19  const PoseModel poseModel, const Point<int>& heatMapSize, const int maxPeaks, const T interMinAboveThreshold,
20  const T interThreshold, const int minSubsetCnt, const T minSubsetScore, const T scaleFactor = 1.f,
21  Array<T> pairScoresCpu = Array<T>{}, T* pairScoresGpuPtr = nullptr,
22  const unsigned int* const bodyPartPairsGpuPtr = nullptr, const unsigned int* const mapIdxGpuPtr = nullptr,
23  const T* const peaksGpuPtr = nullptr);
24 
25  // Private functions used by the 2 above functions
26  template <typename T>
27  std::vector<std::pair<std::vector<int>, T>> createPeopleVector(
28  const T* const heatMapPtr, const T* const peaksPtr, const PoseModel poseModel, const Point<int>& heatMapSize,
29  const int maxPeaks, const T interThreshold, const T interMinAboveThreshold,
30  const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyParts,
31  const unsigned int numberBodyPartPairs, const Array<T>& precomputedPAFs = Array<T>());
32 
33  template <typename T>
34  void removePeopleBelowThresholds(std::vector<int>& validSubsetIndexes, int& numberPeople,
35  const std::vector<std::pair<std::vector<int>, T>>& subsets,
36  const unsigned int numberBodyParts, const int minSubsetCnt,
37  const T minSubsetScore, const int maxPeaks);
38 
39  template <typename T>
40  void peopleVectorToPeopleArray(Array<T>& poseKeypoints, Array<T>& poseScores, const T scaleFactor,
41  const std::vector<std::pair<std::vector<int>, T>>& subsets,
42  const std::vector<int>& validSubsetIndexes, const T* const peaksPtr,
43  const int numberPeople, const unsigned int numberBodyParts,
44  const unsigned int numberBodyPartPairs);
45 
46  template <typename T>
47  std::vector<std::tuple<T, T, int, int, int>> pafPtrIntoVector(
48  const Array<T>& pairScores, const T* const peaksPtr, const int maxPeaks,
49  const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyPartPairs);
50 
51  template <typename T>
52  std::vector<std::pair<std::vector<int>, T>> pafVectorIntoPeopleVector(
53  const std::vector<std::tuple<T, T, int, int, int>>& pairScores, const T* const peaksPtr, const int maxPeaks,
54  const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyParts);
55 }
56 
57 #endif // OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP
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)
PoseModel
Definition: enumClasses.hpp:9
void connectBodyPartsGpu(Array< T > &poseKeypoints, Array< T > &poseScores, const T *const heatMapGpuPtr, 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 > pairScoresCpu=Array< T >{}, T *pairScoresGpuPtr=nullptr, const unsigned int *const bodyPartPairsGpuPtr=nullptr, const unsigned int *const mapIdxGpuPtr=nullptr, const T *const peaksGpuPtr=nullptr)
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)
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 Array< T > &precomputedPAFs=Array< T >())
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)
void connectBodyPartsCpu(Array< T > &poseKeypoints, Array< T > &poseScores, const T *const heatMapPtr, 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)
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
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)