OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
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 defaultNmsThreshold,
14  const T scaleFactor = 1.f, const bool maximizePositives = false);
15 
16  // Windows: Cuda functions do not include OP_API
17  template <typename T>
19  Array<T>& poseKeypoints, Array<T>& poseScores, const T* const heatMapGpuPtr, const T* const peaksPtr,
20  const PoseModel poseModel, const Point<int>& heatMapSize, const int maxPeaks, const T interMinAboveThreshold,
21  const T interThreshold, const int minSubsetCnt, const T minSubsetScore, const T defaultNmsThreshold,
22  const T scaleFactor, const bool maximizePositives, Array<T> pairScoresCpu, T* pairScoresGpuPtr,
23  const unsigned int* const bodyPartPairsGpuPtr, const unsigned int* const mapIdxGpuPtr,
24  const T* const peaksGpuPtr);
25 
26  template <typename T>
28  Array<T>& poseKeypoints, Array<T>& poseScores, const T* const heatMapGpuPtr, const T* const peaksPtr,
29  const PoseModel poseModel, const Point<int>& heatMapSize, const int maxPeaks, const T interMinAboveThreshold,
30  const T interThreshold, const int minSubsetCnt, const T minSubsetScore, const T defaultNmsThreshold,
31  const T scaleFactor = 1.f, const bool maximizePositives = false,
32  Array<T> pairScoresCpu = Array<T>{}, T* pairScoresGpuPtr = nullptr,
33  const unsigned int* const bodyPartPairsGpuPtr = nullptr, const unsigned int* const mapIdxGpuPtr = nullptr,
34  const T* const peaksGpuPtr = nullptr, const int gpuID = 0);
35 
36  // Private functions used by the 2 above functions
37  template <typename T>
38  std::vector<std::pair<std::vector<int>, T>> createPeopleVector(
39  const T* const heatMapPtr, const T* const peaksPtr, const PoseModel poseModel, const Point<int>& heatMapSize,
40  const int maxPeaks, const T interThreshold, const T interMinAboveThreshold,
41  const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyParts,
42  const unsigned int numberBodyPartPairs, const T defaultNmsThreshold,
43  const Array<T>& precomputedPAFs = Array<T>());
44 
45  template <typename T>
47  std::vector<int>& validSubsetIndexes, int& numberPeople,
48  std::vector<std::pair<std::vector<int>, T>>& subsets, const unsigned int numberBodyParts,
49  const int minSubsetCnt, const T minSubsetScore, const bool maximizePositives, const T* const peaksPtr);
50 
51  template <typename T>
53  Array<T>& poseKeypoints, Array<T>& poseScores, const T scaleFactor,
54  const std::vector<std::pair<std::vector<int>, T>>& subsets, const std::vector<int>& validSubsetIndexes,
55  const T* const peaksPtr, const int numberPeople, const unsigned int numberBodyParts,
56  const unsigned int numberBodyPartPairs);
57 
58  template <typename T>
59  std::vector<std::tuple<T, T, int, int, int>> pafPtrIntoVector(
60  const Array<T>& pairScores, const T* const peaksPtr, const int maxPeaks,
61  const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyPartPairs);
62 
63  template <typename T>
64  std::vector<std::pair<std::vector<int>, T>> pafVectorIntoPeopleVector(
65  const std::vector<std::tuple<T, T, int, int, int>>& pairScores, const T* const peaksPtr, const int maxPeaks,
66  const std::vector<unsigned int>& bodyPartPairs, const unsigned int numberBodyParts);
67 }
68 
69 #endif // OPENPOSE_POSE_BODY_PARTS_CONNECTOR_HPP
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 defaultNmsThreshold, const T scaleFactor=1.f, const bool maximizePositives=false)
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)
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)
void connectBodyPartsOcl(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 defaultNmsThreshold, const T scaleFactor=1.f, const bool maximizePositives=false, 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, const int gpuID=0)
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 defaultNmsThreshold, const T scaleFactor, const bool maximizePositives, Array< T > pairScoresCpu, T *pairScoresGpuPtr, const unsigned int *const bodyPartPairsGpuPtr, const unsigned int *const mapIdxGpuPtr, const T *const peaksGpuPtr)
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)
void removePeopleBelowThresholdsAndFillFaces(std::vector< int > &validSubsetIndexes, int &numberPeople, std::vector< std::pair< std::vector< int >, T >> &subsets, const unsigned int numberBodyParts, const int minSubsetCnt, const T minSubsetScore, const bool maximizePositives, const T *const peaksPtr)
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 T defaultNmsThreshold, const Array< T > &precomputedPAFs=Array< T >())
PoseModel
Definition: enumClasses.hpp:10