All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
faceExtractorNet.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_FACE_FACE_EXTRACTOR_HPP
#define OPENPOSE_FACE_FACE_EXTRACTOR_HPP
#include <atomic>
#include <opencv2/core/core.hpp> // cv::Mat
#include <openpose/core/common.hpp>
#include <openpose/core/enumClasses.hpp>
namespace op
{
class OP_API FaceExtractorNet
{
public:
explicit FaceExtractorNet(const Point<int>& netInputSize, const Point<int>& netOutputSize,
const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScale = ScaleMode::ZeroToOne);
virtual ~FaceExtractorNet();
void initializationOnThread();
virtual void forwardPass(const std::vector<Rectangle<float>>& faceRectangles, const cv::Mat& cvInputData) = 0;
Array<float> getHeatMaps() const;
Array<float> getFaceKeypoints() const;
bool getEnabled() const;
void setEnabled(const bool enabled);
protected:
const Point<int> mNetOutputSize;
Array<float> mFaceImageCrop;
Array<float> mFaceKeypoints;
// HeatMaps parameters
Array<float> mHeatMaps;
const ScaleMode mHeatMapScaleMode;
const std::vector<HeatMapType> mHeatMapTypes;
// Temporarily disable it
std::atomic<bool> mEnabled;
virtual void netInitializationOnThread() = 0;
private:
// Init with thread
std::thread::id mThreadId;
void checkThread() const;
DELETE_COPY(FaceExtractorNet);
};
}
#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