OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
poseExtractorCaffe.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_POSE_POSE_EXTRACTOR_CAFFE_HPP
2 #define OPENPOSE_POSE_POSE_EXTRACTOR_CAFFE_HPP
3 
13 
14 namespace op
15 {
17  {
18  public:
20  const PoseModel poseModel, const std::string& modelFolder, const int gpuId,
21  const std::vector<HeatMapType>& heatMapTypes = {},
22  const ScaleMode heatMapScaleMode = ScaleMode::ZeroToOneFixedAspect,
23  const bool addPartCandidates = false, const bool maximizePositives = false,
24  const std::string& protoTxtPath = "", const std::string& caffeModelPath = "",
25  const float upsamplingRatio = 0.f, const bool enableNet = true,
26  const bool enableGoogleLogging = true);
27 
29 
30  virtual void netInitializationOnThread();
31 
39  virtual void forwardPass(
40  const std::vector<Array<float>>& inputNetData, const Point<int>& inputDataSize,
41  const std::vector<double>& scaleInputToNetInputs = {1.f},
42  const Array<float>& poseNetOutput = Array<float>{});
43 
44  const float* getCandidatesCpuConstPtr() const;
45 
46  const float* getCandidatesGpuConstPtr() const;
47 
48  const float* getHeatMapCpuConstPtr() const;
49 
50  const float* getHeatMapGpuConstPtr() const;
51 
52  std::vector<int> getHeatMapSize() const;
53 
54  const float* getPoseGpuConstPtr() const;
55 
56  private:
57  // Used when increasing spNets
58  const PoseModel mPoseModel;
59  const int mGpuId;
60  const std::string mModelFolder;
61  const std::string mProtoTxtPath;
62  const std::string mCaffeModelPath;
63  const float mUpsamplingRatio;
64  const bool mEnableNet;
65  const bool mEnableGoogleLogging;
66  // General parameters
67  std::vector<std::shared_ptr<Net>> spNets;
68  std::shared_ptr<ResizeAndMergeCaffe<float>> spResizeAndMergeCaffe;
69  std::shared_ptr<NmsCaffe<float>> spNmsCaffe;
70  std::shared_ptr<BodyPartConnectorCaffe<float>> spBodyPartConnectorCaffe;
71  std::shared_ptr<MaximumCaffe<float>> spMaximumCaffe;
72  std::vector<std::vector<int>> mNetInput4DSizes;
73  // Init with thread
74  std::vector<std::shared_ptr<ArrayCpuGpu<float>>> spCaffeNetOutputBlobs;
75  std::shared_ptr<ArrayCpuGpu<float>> spHeatMapsBlob;
76  std::shared_ptr<ArrayCpuGpu<float>> spPeaksBlob;
77  std::shared_ptr<ArrayCpuGpu<float>> spMaximumPeaksBlob;
78 
80  };
81 }
82 
83 #endif // OPENPOSE_POSE_POSE_EXTRACTOR_CAFFE_HPP
const float * getCandidatesCpuConstPtr() const
virtual ~PoseExtractorCaffe()
std::vector< int > getHeatMapSize() const
const float * getCandidatesGpuConstPtr() const
PoseExtractorCaffe(const PoseModel poseModel, const std::string &modelFolder, const int gpuId, const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScaleMode=ScaleMode::ZeroToOneFixedAspect, const bool addPartCandidates=false, const bool maximizePositives=false, const std::string &protoTxtPath="", const std::string &caffeModelPath="", const float upsamplingRatio=0.f, const bool enableNet=true, const bool enableGoogleLogging=true)
const float * getPoseGpuConstPtr() const
const float * getHeatMapCpuConstPtr() const
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 >{})
const float * getHeatMapGpuConstPtr() const
virtual void netInitializationOnThread()
#define OP_API
Definition: macros.hpp:18
#define DELETE_COPY(className)
Definition: macros.hpp:32
PoseModel
Definition: enumClasses.hpp:10
ScaleMode
Definition: enumClasses.hpp:7