OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
bodyPartConnectorCaffe.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_POSE_BODY_PART_CONNECTOR_CAFFE_HPP
2 #define OPENPOSE_POSE_BODY_PART_CONNECTOR_CAFFE_HPP
3 
6 
7 namespace op
8 {
9  // It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep
10  // the compatibility with any generic Caffe version, we keep this 'layer' inside our library rather than in the
11  // Caffe code.
12  template <typename T>
14  {
15  public:
17 
19 
20  virtual void Reshape(const std::vector<ArrayCpuGpu<T>*>& bottom, const int gpuID = 0);
21 
22  virtual inline const char* type() const { return "BodyPartConnector"; }
23 
24  void setPoseModel(const PoseModel poseModel);
25 
26  void setMaximizePositives(const bool maximizePositives);
27 
28  void setDefaultNmsThreshold(const T defaultNmsThreshold);
29 
30  void setInterMinAboveThreshold(const T interMinAboveThreshold);
31 
32  void setInterThreshold(const T interThreshold);
33 
34  void setMinSubsetCnt(const int minSubsetCnt);
35 
36  void setMinSubsetScore(const T minSubsetScore);
37 
38  void setScaleNetToOutput(const T scaleNetToOutput);
39 
40  virtual void Forward(const std::vector<ArrayCpuGpu<T>*>& bottom, Array<T>& poseKeypoints,
41  Array<T>& poseScores);
42 
43  virtual void Forward_cpu(const std::vector<ArrayCpuGpu<T>*>& bottom, Array<T>& poseKeypoints,
44  Array<T>& poseScores);
45 
46  virtual void Forward_gpu(const std::vector<ArrayCpuGpu<T>*>& bottom, Array<T>& poseKeypoints,
47  Array<T>& poseScores);
48 
49  virtual void Forward_ocl(const std::vector<ArrayCpuGpu<T>*>& bottom, Array<T>& poseKeypoints,
50  Array<T>& poseScores);
51 
52  virtual void Backward_cpu(const std::vector<ArrayCpuGpu<T>*>& top, const std::vector<bool>& propagate_down,
53  const std::vector<ArrayCpuGpu<T>*>& bottom);
54 
55  virtual void Backward_gpu(const std::vector<ArrayCpuGpu<T>*>& top, const std::vector<bool>& propagate_down,
56  const std::vector<ArrayCpuGpu<T>*>& bottom);
57 
58  private:
59  PoseModel mPoseModel;
60  bool mMaximizePositives;
61  T mDefaultNmsThreshold;
62  T mInterMinAboveThreshold;
63  T mInterThreshold;
64  int mMinSubsetCnt;
65  T mMinSubsetScore;
66  T mScaleNetToOutput;
67  std::array<int, 4> mHeatMapsSize;
68  std::array<int, 4> mPeaksSize;
69  std::array<int, 4> mTopSize;
70  // GPU auxiliary
71  unsigned int* pBodyPartPairsGpuPtr;
72  unsigned int* pMapIdxGpuPtr;
73  Array<T> mFinalOutputCpu;
74  T* pFinalOutputGpuPtr;
75  int mGpuID;
76 
77  DELETE_COPY(BodyPartConnectorCaffe);
78  };
79 }
80 
81 #endif // OPENPOSE_POSE_BODY_PART_CONNECTOR_CAFFE_HPP
virtual void Forward_cpu(const std::vector< ArrayCpuGpu< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
void setScaleNetToOutput(const T scaleNetToOutput)
void setPoseModel(const PoseModel poseModel)
virtual void Forward_ocl(const std::vector< ArrayCpuGpu< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
virtual void Forward(const std::vector< ArrayCpuGpu< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
void setMinSubsetCnt(const int minSubsetCnt)
void setMaximizePositives(const bool maximizePositives)
void setInterThreshold(const T interThreshold)
void setInterMinAboveThreshold(const T interMinAboveThreshold)
virtual void Backward_cpu(const std::vector< ArrayCpuGpu< T > * > &top, const std::vector< bool > &propagate_down, const std::vector< ArrayCpuGpu< T > * > &bottom)
void setMinSubsetScore(const T minSubsetScore)
virtual void Forward_gpu(const std::vector< ArrayCpuGpu< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
virtual void Reshape(const std::vector< ArrayCpuGpu< T > * > &bottom, const int gpuID=0)
virtual void Backward_gpu(const std::vector< ArrayCpuGpu< T > * > &top, const std::vector< bool > &propagate_down, const std::vector< ArrayCpuGpu< T > * > &bottom)
virtual const char * type() const
void setDefaultNmsThreshold(const T defaultNmsThreshold)
PoseModel
Definition: enumClasses.hpp:10