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
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 // PIMPL does not work here. Alternative:
8 // stackoverflow.com/questions/13978775/how-to-avoid-include-dependency-to-external-library?answertab=active#tab-top
9 namespace caffe
10 {
11  template <typename T> class Blob;
12 }
13 
14 namespace op
15 {
16  // It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep
17  // the compatibility with any generic Caffe version, we keep this 'layer' inside our library rather than in the
18  // Caffe code.
19  template <typename T>
21  {
22  public:
23  explicit BodyPartConnectorCaffe();
24 
25  virtual void Reshape(const std::vector<caffe::Blob<T>*>& bottom);
26 
27  virtual inline const char* type() const { return "BodyPartConnector"; }
28 
29  void setPoseModel(const PoseModel poseModel);
30 
31  void setInterMinAboveThreshold(const T interMinAboveThreshold);
32 
33  void setInterThreshold(const T interThreshold);
34 
35  void setMinSubsetCnt(const int minSubsetCnt);
36 
37  void setMinSubsetScore(const T minSubsetScore);
38 
39  void setScaleNetToOutput(const T scaleNetToOutput);
40 
41  virtual void Forward_cpu(const std::vector<caffe::Blob<T>*>& bottom, Array<T>& poseKeypoints,
42  Array<T>& poseScores);
43 
44  virtual void Forward_gpu(const std::vector<caffe::Blob<T>*>& bottom, Array<T>& poseKeypoints,
45  Array<T>& poseScores);
46 
47  virtual void Backward_cpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down,
48  const std::vector<caffe::Blob<T>*>& bottom);
49 
50  virtual void Backward_gpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down,
51  const std::vector<caffe::Blob<T>*>& bottom);
52 
53  private:
54  PoseModel mPoseModel;
55  T mInterMinAboveThreshold;
56  T mInterThreshold;
57  int mMinSubsetCnt;
58  T mMinSubsetScore;
59  T mScaleNetToOutput;
60  std::array<int, 4> mHeatMapsSize;
61  std::array<int, 4> mPeaksSize;
62  std::array<int, 4> mTopSize;
63 
65  };
66 }
67 
68 #endif // OPENPOSE_POSE_BODY_PART_CONNECTOR_CAFFE_HPP
#define DELETE_COPY(className)
Definition: macros.hpp:30
PoseModel
Definition: enumClasses.hpp:9
virtual const char * type() const
Definition: bodyPartConnectorCaffe.hpp:27
Definition: macros.hpp:77
Definition: array.hpp:20
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
#define OP_API
Definition: macros.hpp:15
Definition: bodyPartConnectorCaffe.hpp:20