OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <openpose/core/common.hpp>
5 #include <openpose/pose/enumClasses.hpp>
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>
13 class BodyPartConnectorCaffe
14 {
15 public:
16 explicit BodyPartConnectorCaffe();
17
18 virtual ~BodyPartConnectorCaffe();
19
20 virtual void Reshape(const std::vector<caffe::Blob<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 setInterMinAboveThreshold(const T interMinAboveThreshold);
29
30 void setInterThreshold(const T interThreshold);
31
32 void setMinSubsetCnt(const int minSubsetCnt);
33
34 void setMinSubsetScore(const T minSubsetScore);
35
36 void setScaleNetToOutput(const T scaleNetToOutput);
37
38 virtual void Forward(const std::vector<caffe::Blob<T>*>& bottom, Array<T>& poseKeypoints,
39 Array<T>& poseScores);
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 Forward_ocl(const std::vector<caffe::Blob<T>*>& bottom, Array<T>& poseKeypoints,
48 Array<T>& poseScores);
49
50 virtual void Backward_cpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down,
51 const std::vector<caffe::Blob<T>*>& bottom);
52
53 virtual void Backward_gpu(const std::vector<caffe::Blob<T>*>& top, const std::vector<bool>& propagate_down,
54 const std::vector<caffe::Blob<T>*>& bottom);
55
56 private:
57 PoseModel mPoseModel;
58 bool mMaximizePositives;
59 T mInterMinAboveThreshold;
60 T mInterThreshold;
61 int mMinSubsetCnt;
62 T mMinSubsetScore;
63 T mScaleNetToOutput;
64 std::array<int, 4> mHeatMapsSize;
65 std::array<int, 4> mPeaksSize;
66 std::array<int, 4> mTopSize;
67 // GPU auxiliary
68 unsigned int* pBodyPartPairsGpuPtr;
69 unsigned int* pMapIdxGpuPtr;
70 Array<T> mFinalOutputCpu;
71 T* pFinalOutputGpuPtr;
72 int mGpuID;
73
74 DELETE_COPY(BodyPartConnectorCaffe);
75 };
76 }
77
78 #endif // OPENPOSE_POSE_BODY_PART_CONNECTOR_CAFFE_HPP
enumClasses.hpp
op::BodyPartConnectorCaffe::setMinSubsetCnt
void setMinSubsetCnt(const int minSubsetCnt)
op::BodyPartConnectorCaffe::Forward_gpu
virtual void Forward_gpu(const std::vector< caffe::Blob< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
op::BodyPartConnectorCaffe::setScaleNetToOutput
void setScaleNetToOutput(const T scaleNetToOutput)
op::PoseModel
PoseModel
Definition: enumClasses.hpp:9
op::BodyPartConnectorCaffe::Backward_cpu
virtual void Backward_cpu(const std::vector< caffe::Blob< T > * > &top, const std::vector< bool > &propagate_down, const std::vector< caffe::Blob< T > * > &bottom)
op::BodyPartConnectorCaffe::setMaximizePositives
void setMaximizePositives(const bool maximizePositives)
op::BodyPartConnectorCaffe::Forward_cpu
virtual void Forward_cpu(const std::vector< caffe::Blob< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
op::BodyPartConnectorCaffe::~BodyPartConnectorCaffe
virtual ~BodyPartConnectorCaffe()
op::BodyPartConnectorCaffe::Reshape
virtual void Reshape(const std::vector< caffe::Blob< T > * > &bottom, const int gpuID=0)
common.hpp
op::BodyPartConnectorCaffe::type
virtual const char * type() const
Definition: bodyPartConnectorCaffe.hpp:22
op::BodyPartConnectorCaffe::BodyPartConnectorCaffe
BodyPartConnectorCaffe()
op::BodyPartConnectorCaffe::setMinSubsetScore
void setMinSubsetScore(const T minSubsetScore)
op::BodyPartConnectorCaffe::Forward_ocl
virtual void Forward_ocl(const std::vector< caffe::Blob< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
op::BodyPartConnectorCaffe::setInterMinAboveThreshold
void setInterMinAboveThreshold(const T interMinAboveThreshold)
caffe::Blob
Definition: macros.hpp:81
op::Array
Definition: array.hpp:20
op::BodyPartConnectorCaffe::setPoseModel
void setPoseModel(const PoseModel poseModel)
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
op::BodyPartConnectorCaffe::setInterThreshold
void setInterThreshold(const T interThreshold)
op::BodyPartConnectorCaffe::Forward
virtual void Forward(const std::vector< caffe::Blob< T > * > &bottom, Array< T > &poseKeypoints, Array< T > &poseScores)
op::BodyPartConnectorCaffe
Definition: bodyPartConnectorCaffe.hpp:13
op::BodyPartConnectorCaffe::Backward_gpu
virtual void Backward_gpu(const std::vector< caffe::Blob< T > * > &top, const std::vector< bool > &propagate_down, const std::vector< caffe::Blob< T > * > &bottom)