OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
poseExtractorNet.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
2 #define OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
3 
4 #include <atomic>
8 
9 namespace op
10 {
12  {
13  public:
14  PoseExtractorNet(const PoseModel poseModel,
15  const std::vector<HeatMapType>& heatMapTypes = {},
16  const ScaleMode heatMapScaleMode = ScaleMode::ZeroToOneFixedAspect,
17  const bool addPartCandidates = false,
18  const bool maximizePositives = false);
19 
20  virtual ~PoseExtractorNet();
21 
23 
24  virtual void forwardPass(
25  const std::vector<Array<float>>& inputNetData, const Point<int>& inputDataSize,
26  const std::vector<double>& scaleRatios = {1.f}, const Array<float>& poseNetOutput = Array<float>{}) = 0;
27 
28  virtual const float* getCandidatesCpuConstPtr() const = 0;
29 
30  virtual const float* getCandidatesGpuConstPtr() const = 0;
31 
32  virtual const float* getHeatMapCpuConstPtr() const = 0;
33 
34  virtual const float* getHeatMapGpuConstPtr() const = 0;
35 
36  virtual std::vector<int> getHeatMapSize() const = 0;
37 
39 
40  std::vector<std::vector<std::array<float,3>>> getCandidatesCopy() const;
41 
42  virtual const float* getPoseGpuConstPtr() const = 0;
43 
45 
47 
48  float getScaleNetToOutput() const;
49 
50  double get(const PoseProperty property) const;
51 
52  void set(const PoseProperty property, const double value);
53 
54  void increase(const PoseProperty property, const double value);
55 
56  void clear();
57 
58  protected:
64 
65  void checkThread() const;
66 
67  virtual void netInitializationOnThread() = 0;
68 
69  private:
70  const std::vector<HeatMapType> mHeatMapTypes;
71  const ScaleMode mHeatMapScaleMode;
72  const bool mAddPartCandidates;
73  std::array<std::atomic<double>, (int)PoseProperty::Size> mProperties;
74  std::thread::id mThreadId;
75 
77  };
78 }
79 
80 #endif // OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
virtual const float * getCandidatesCpuConstPtr() const =0
Array< float > getPoseKeypoints() const
Array< float > getPoseScores() const
void increase(const PoseProperty property, const double value)
virtual std::vector< int > getHeatMapSize() const =0
Array< float > mPoseScores
virtual const float * getPoseGpuConstPtr() const =0
PoseExtractorNet(const PoseModel poseModel, const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScaleMode=ScaleMode::ZeroToOneFixedAspect, const bool addPartCandidates=false, const bool maximizePositives=false)
std::vector< std::vector< std::array< float, 3 > > > getCandidatesCopy() const
void set(const PoseProperty property, const double value)
virtual const float * getHeatMapCpuConstPtr() const =0
void checkThread() const
const PoseModel mPoseModel
virtual void forwardPass(const std::vector< Array< float >> &inputNetData, const Point< int > &inputDataSize, const std::vector< double > &scaleRatios={1.f}, const Array< float > &poseNetOutput=Array< float >{})=0
virtual ~PoseExtractorNet()
virtual void netInitializationOnThread()=0
double get(const PoseProperty property) const
Array< float > mPoseKeypoints
virtual const float * getCandidatesGpuConstPtr() const =0
float getScaleNetToOutput() const
virtual const float * getHeatMapGpuConstPtr() const =0
Array< float > getHeatMapsCopy() const
#define OP_API
Definition: macros.hpp:18
#define DELETE_COPY(className)
Definition: macros.hpp:32
PoseProperty
Definition: enumClasses.hpp:33
PoseModel
Definition: enumClasses.hpp:10
ScaleMode
Definition: enumClasses.hpp:7