Antal.Ai - Virtual Makeup
Public Member Functions | List of all members
core::face::FaceMesh Class Reference

A class responsible for initializing, configuring, and processing face mesh detection using neural networks. More...

#include <FaceMesh.h>

Inheritance diagram for core::face::FaceMesh:
Inheritance graph
[legend]
Collaboration diagram for core::face::FaceMesh:
Collaboration graph
[legend]

Public Member Functions

 FaceMesh ()=default
 Default constructor for the FaceMesh class.
 
 ~FaceMesh ()=default
 Default destructor for the FaceMesh class.
 
void init (std::string framework, std::string modelWeightsFile, std::string classesFile, std::string modelConfigurationFile, std::string inputLayerName, std::string outputLayerName, std::string networkName, int inputWidth, int inputHeight, double scale, double mean0, double mean1, double mean2, std::string configBackend, std::string configTarget, double confidenceThreshold)
 Initializes the neural network for face mesh detection. More...
 
void process (const cv::Mat &frame, std::vector< core::Detection > &detections)
 Processes an input frame to detect face meshes. More...
 
- Public Member Functions inherited from core::NeuralBase
std::string getName ()
 Gets the name of the neural network. More...
 
double getInferenceTime ()
 Gets the inference time of the network. More...
 
void loadNetwork (std::string framework, std::string modelWeightsFile, std::string classesFile="", std::string modelConfigurationFile="", std::string inputLayerName="", std::string outputLayerName="")
 Loads the neural network from memory buffer. More...
 
void configureNetwork (std::string name, int inputWidth, int inputHeight, double scale, double mean0, double mean1, double mean2, std::string configBackend, std::string configTarget, double confidenceThreshold)
 Configures the network with various parameters. More...
 
std::vector< std::string > getOutputsNames (const cv::dnn::Net &net)
 Gets the names of the output layers of the network. More...
 

Additional Inherited Members

- Protected Attributes inherited from core::NeuralBase
std::string mFramework
 
std::string mInputLayerName
 
std::string mOutputLayerName
 
std::string mName
 
cv::dnn::Net mNet
 
std::vector< std::string > classes
 
double scaleFactor = 1.0
 
cv::Scalar mean { 0.0, 0.0, 0.0 }
 
cv::Size size { 128, 128 }
 
cv::dnn::Backend selectedBackend
 
cv::dnn::Target selectedTarget
 
float confThreshold = 0.5F
 
std::map< std::string, cv::dnn::Backend > backends
 
std::map< std::string, cv::dnn::Target > targets
 

Detailed Description

A class responsible for initializing, configuring, and processing face mesh detection using neural networks.

Inherits from NeuralBase and facilitates face detection with customizable network configurations, layer specifications, and processing parameters.

Member Function Documentation

◆ init()

void core::face::FaceMesh::init ( std::string  framework,
std::string  modelWeightsFile,
std::string  classesFile,
std::string  modelConfigurationFile,
std::string  inputLayerName,
std::string  outputLayerName,
std::string  networkName,
int  inputWidth,
int  inputHeight,
double  scale,
double  mean0,
double  mean1,
double  mean2,
std::string  configBackend,
std::string  configTarget,
double  confidenceThreshold 
)

Initializes the neural network for face mesh detection.

Parameters
frameworkThe framework to use for the model (e.g., "TensorFlow", "Caffe").
modelWeightsFilePath to the file containing the model weights.
classesFilePath to the file containing class labels.
modelConfigurationFilePath to the model configuration file.
inputLayerNameName of the network's input layer.
outputLayerNameName of the network's output layer.
networkNameThe name identifier for the neural network.
inputWidthWidth of the network's input.
inputHeightHeight of the network's input.
scaleScaling factor to normalize the input image.
mean0Mean value for the first channel normalization.
mean1Mean value for the second channel normalization.
mean2Mean value for the third channel normalization.
configBackendBackend configuration for processing.
configTargetTarget hardware configuration for processing.
confidenceThresholdMinimum confidence level for detections.

◆ process()

void core::face::FaceMesh::process ( const cv::Mat &  frame,
std::vector< core::Detection > &  detections 
)

Processes an input frame to detect face meshes.

Parameters
frameThe input image frame in which face detection is to be processed.
detectionsA vector to store the detected face meshes.

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