Antal.Ai - Virtual Makeup
|
A class responsible for initializing, configuring, and processing face mesh detection using neural networks. More...
#include <FaceMesh.h>
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... | |
![]() | |
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 | |
![]() | |
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 |
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.
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.
framework | The framework to use for the model (e.g., "TensorFlow", "Caffe"). |
modelWeightsFile | Path to the file containing the model weights. |
classesFile | Path to the file containing class labels. |
modelConfigurationFile | Path to the model configuration file. |
inputLayerName | Name of the network's input layer. |
outputLayerName | Name of the network's output layer. |
networkName | The name identifier for the neural network. |
inputWidth | Width of the network's input. |
inputHeight | Height of the network's input. |
scale | Scaling factor to normalize the input image. |
mean0 | Mean value for the first channel normalization. |
mean1 | Mean value for the second channel normalization. |
mean2 | Mean value for the third channel normalization. |
configBackend | Backend configuration for processing. |
configTarget | Target hardware configuration for processing. |
confidenceThreshold | Minimum confidence level for detections. |
void core::face::FaceMesh::process | ( | const cv::Mat & | frame, |
std::vector< core::Detection > & | detections | ||
) |
Processes an input frame to detect face meshes.
frame | The input image frame in which face detection is to be processed. |
detections | A vector to store the detected face meshes. |