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
faceExtractorNet.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_FACE_FACE_EXTRACTOR_HPP
2 #define OPENPOSE_FACE_FACE_EXTRACTOR_HPP
3
4 #include <atomic>
5 #include <opencv2/core/core.hpp> // cv::Mat
6 #include <openpose/core/common.hpp>
7 #include <openpose/core/enumClasses.hpp>
8
9 namespace op
10 {
14 class OP_API FaceExtractorNet
15 {
16 public:
22 explicit FaceExtractorNet(const Point<int>& netInputSize, const Point<int>& netOutputSize,
23 const std::vector<HeatMapType>& heatMapTypes = {},
24 const ScaleMode heatMapScale = ScaleMode::ZeroToOne);
25
30 virtual ~FaceExtractorNet();
31
36 void initializationOnThread();
37
46 virtual void forwardPass(const std::vector<Rectangle<float>>& faceRectangles, const cv::Mat& cvInputData) = 0;
47
48 Array<float> getHeatMaps() const;
49
57 Array<float> getFaceKeypoints() const;
58
59 bool getEnabled() const;
60
61 void setEnabled(const bool enabled);
62
63 protected:
64 const Point<int> mNetOutputSize;
65 Array<float> mFaceImageCrop;
66 Array<float> mFaceKeypoints;
67 // HeatMaps parameters
68 Array<float> mHeatMaps;
69 const ScaleMode mHeatMapScaleMode;
70 const std::vector<HeatMapType> mHeatMapTypes;
71 // Temporarily disable it
72 std::atomic<bool> mEnabled;
73
74 virtual void netInitializationOnThread() = 0;
75
76 private:
77 // Init with thread
78 std::thread::id mThreadId;
79
80 void checkThread() const;
81
82 DELETE_COPY(FaceExtractorNet);
83 };
84 }
85
86 #endif // OPENPOSE_FACE_FACE_EXTRACTOR_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
op::FaceExtractorNet::mFaceKeypoints
Array< float > mFaceKeypoints
Definition: faceExtractorNet.hpp:66
op::FaceExtractorNet::mHeatMapTypes
const std::vector< HeatMapType > mHeatMapTypes
Definition: faceExtractorNet.hpp:70
op::Point< int >
op::FaceExtractorNet::mHeatMapScaleMode
const ScaleMode mHeatMapScaleMode
Definition: faceExtractorNet.hpp:69
common.hpp
op::ScaleMode::ZeroToOne
op::ScaleMode
ScaleMode
Definition: enumClasses.hpp:6
op::Array< float >
op::FaceExtractorNet
Definition: faceExtractorNet.hpp:14
op::Rectangle
Definition: rectangle.hpp:11
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
op::FaceExtractorNet::mEnabled
std::atomic< bool > mEnabled
Definition: faceExtractorNet.hpp:72
op::FaceExtractorNet::mNetOutputSize
const Point< int > mNetOutputSize
Definition: faceExtractorNet.hpp:64
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
op::FaceExtractorNet::mHeatMaps
Array< float > mHeatMaps
Definition: faceExtractorNet.hpp:68
op::FaceExtractorNet::mFaceImageCrop
Array< float > mFaceImageCrop
Definition: faceExtractorNet.hpp:65