OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::FaceExtractorNet Class Referenceabstract

#include <faceExtractorNet.hpp>

Inheritance diagram for op::FaceExtractorNet:

Public Member Functions

 FaceExtractorNet (const Point< int > &netInputSize, const Point< int > &netOutputSize, const std::vector< HeatMapType > &heatMapTypes={}, const ScaleMode heatMapScaleMode=ScaleMode::ZeroToOneFixedAspect)
virtual ~FaceExtractorNet ()
void initializationOnThread ()
virtual void forwardPass (const std::vector< Rectangle< float >> &faceRectangles, const Matrix &inputData)=0
Array< float > getHeatMaps () const
Array< float > getFaceKeypoints () const
bool getEnabled () const
void setEnabled (const bool enabled)

Protected Member Functions

virtual void netInitializationOnThread ()=0

Protected Attributes

const Point< int > mNetOutputSize
Array< float > mFaceImageCrop
Array< float > mFaceKeypoints
Array< float > mHeatMaps
const ScaleMode mHeatMapScaleMode
const std::vector< HeatMapTypemHeatMapTypes
std::atomic< bool > mEnabled

Detailed Description

Face keypoint extractor class.

Definition at line 13 of file faceExtractorNet.hpp.

Constructor & Destructor Documentation

◆ FaceExtractorNet()

op::FaceExtractorNet::FaceExtractorNet ( const Point< int > &  netInputSize,
const Point< int > &  netOutputSize,
const std::vector< HeatMapType > &  heatMapTypes = {},
const ScaleMode  heatMapScaleMode = ScaleMode::ZeroToOneFixedAspect 

Constructor of the FaceExtractorNet class.

netInputSizeSize at which the cropped image (where the face is located) is resized.
netOutputSizeSize of the final results. At the moment, it must be equal than netOutputSize.

◆ ~FaceExtractorNet()

virtual op::FaceExtractorNet::~FaceExtractorNet ( )

Virtual destructor of the HandExtractor class. Required to allow inheritance.

Member Function Documentation

◆ forwardPass()

virtual void op::FaceExtractorNet::forwardPass ( const std::vector< Rectangle< float >> &  faceRectangles,
const Matrix inputData 
pure virtual

This function extracts the face keypoints for each detected face in the image.

faceRectangleslocation of the faces in the image. It is a length-variable std::vector, where each index corresponds to a different person in the image. Internally, a op::Rectangle<float> (similar to cv::Rect for floating values) with the position of that face (or 0,0,0,0 if some face is missing, e.g., if a specific person has only half of the body inside the image).
cvInputDataOriginal image in Mat format and BGR format.

Implemented in op::FaceExtractorCaffe.

◆ getEnabled()

bool op::FaceExtractorNet::getEnabled ( ) const

◆ getFaceKeypoints()

Array<float> op::FaceExtractorNet::getFaceKeypoints ( ) const

This function returns the face keypoins. VERY IMPORTANT: use getFaceKeypoints().clone() if the keypoints are going to be edited in a different thread.

A Array with all the face keypoints. It follows the pose structure, i.e., the first dimension corresponds to all the people in the image, the second to each specific keypoint, and the third one to (x, y, score).

◆ getHeatMaps()

Array<float> op::FaceExtractorNet::getHeatMaps ( ) const

◆ initializationOnThread()

void op::FaceExtractorNet::initializationOnThread ( )

This function must be call before using any other function. It must also be called inside the thread in which the functions are going to be used.

◆ netInitializationOnThread()

virtual void op::FaceExtractorNet::netInitializationOnThread ( )
protectedpure virtual

Implemented in op::FaceExtractorCaffe.

◆ setEnabled()

void op::FaceExtractorNet::setEnabled ( const bool  enabled)

Member Data Documentation

◆ mEnabled

std::atomic<bool> op::FaceExtractorNet::mEnabled

Definition at line 71 of file faceExtractorNet.hpp.

◆ mFaceImageCrop

Array<float> op::FaceExtractorNet::mFaceImageCrop

Definition at line 64 of file faceExtractorNet.hpp.

◆ mFaceKeypoints

Array<float> op::FaceExtractorNet::mFaceKeypoints

Definition at line 65 of file faceExtractorNet.hpp.

◆ mHeatMaps

Array<float> op::FaceExtractorNet::mHeatMaps

Definition at line 67 of file faceExtractorNet.hpp.

◆ mHeatMapScaleMode

const ScaleMode op::FaceExtractorNet::mHeatMapScaleMode

Definition at line 68 of file faceExtractorNet.hpp.

◆ mHeatMapTypes

const std::vector<HeatMapType> op::FaceExtractorNet::mHeatMapTypes

Definition at line 69 of file faceExtractorNet.hpp.

◆ mNetOutputSize

const Point<int> op::FaceExtractorNet::mNetOutputSize

Definition at line 63 of file faceExtractorNet.hpp.

The documentation for this class was generated from the following file: