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
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>
5 #include <openpose/core/common.hpp>
6 #include <openpose/core/enumClasses.hpp>
7 #include <openpose/pose/poseParameters.hpp>
8
9 namespace op
10 {
11 class OP_API PoseExtractorNet
12 {
13 public:
14 PoseExtractorNet(const PoseModel poseModel,
15 const std::vector<HeatMapType>& heatMapTypes = {},
16 const ScaleMode heatMapScale = ScaleMode::ZeroToOne,
17 const bool addPartCandidates = false,
18 const bool maximizePositives = false);
19
20 virtual ~PoseExtractorNet();
21
22 void initializationOnThread();
23
24 virtual void forwardPass(const std::vector<Array<float>>& inputNetData, const Point<int>& inputDataSize,
25 const std::vector<double>& scaleRatios = {1.f}) = 0;
26
27 virtual const float* getCandidatesCpuConstPtr() const = 0;
28
29 virtual const float* getCandidatesGpuConstPtr() const = 0;
30
31 virtual const float* getHeatMapCpuConstPtr() const = 0;
32
33 virtual const float* getHeatMapGpuConstPtr() const = 0;
34
35 virtual std::vector<int> getHeatMapSize() const = 0;
36
37 Array<float> getHeatMapsCopy() const;
38
39 std::vector<std::vector<std::array<float,3>>> getCandidatesCopy() const;
40
41 virtual const float* getPoseGpuConstPtr() const = 0;
42
43 Array<float> getPoseKeypoints() const;
44
45 Array<float> getPoseScores() const;
46
47 float getScaleNetToOutput() const;
48
49 double get(const PoseProperty property) const;
50
51 void set(const PoseProperty property, const double value);
52
53 void increase(const PoseProperty property, const double value);
54
55 void clear();
56
57 protected:
58 const PoseModel mPoseModel;
59 Point<int> mNetOutputSize;
60 Array<float> mPoseKeypoints;
61 Array<float> mPoseScores;
62 float mScaleNetToOutput;
63
64 void checkThread() const;
65
66 virtual void netInitializationOnThread() = 0;
67
68 private:
69 const std::vector<HeatMapType> mHeatMapTypes;
70 const ScaleMode mHeatMapScaleMode;
71 const bool mAddPartCandidates;
72 std::array<std::atomic<double>, (int)PoseProperty::Size> mProperties;
73 std::thread::id mThreadId;
74
75 DELETE_COPY(PoseExtractorNet);
76 };
77 }
78
79 #endif // OPENPOSE_POSE_POSE_EXTRACTOR_NET_HPP
op::PoseExtractorNet::mPoseKeypoints
Array< float > mPoseKeypoints
Definition: poseExtractorNet.hpp:60
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
op::PoseExtractorNet::mNetOutputSize
Point< int > mNetOutputSize
Definition: poseExtractorNet.hpp:59
op::PoseExtractorNet::mScaleNetToOutput
float mScaleNetToOutput
Definition: poseExtractorNet.hpp:62
poseParameters.hpp
op::PoseModel
PoseModel
Definition: enumClasses.hpp:9
op::PoseProperty::Size
op::Point< int >
op::PoseExtractorNet::mPoseScores
Array< float > mPoseScores
Definition: poseExtractorNet.hpp:61
common.hpp
op::ScaleMode::ZeroToOne
op::PoseExtractorNet::mPoseModel
const PoseModel mPoseModel
Definition: poseExtractorNet.hpp:58
op::PoseProperty
PoseProperty
Definition: enumClasses.hpp:33
op::ScaleMode
ScaleMode
Definition: enumClasses.hpp:6
op::Array< float >
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
op::PoseExtractorNet
Definition: poseExtractorNet.hpp:11