Spoofing Detection Engine  1.0
FaceMesh.h
1 #pragma once
2 
3 #include "Detection.h"
4 #include "NeuralBase.h"
5 #include <opencv2/dnn.hpp>
6 
7 namespace core {
8  namespace face {
16  class FaceMesh : public NeuralBase {
17  public:
21  FaceMesh() = default;
22 
26  ~FaceMesh() = default;
27 
48  void init(std::string framework,
49  std::string modelWeightsFile,
50  std::string classesFile,
51  std::string modelConfigurationFile,
52  std::string inputLayerName,
53  std::string outputLayerName,
54  std::string networkName,
55  int inputWidth,
56  int inputHeight,
57  double scale,
58  double mean0,
59  double mean1,
60  double mean2,
61  std::string configBackend,
62  std::string configTarget,
63  double confidenceThreshold);
64 
71  void process(const cv::Mat& frame, std::vector<core::Detection>& detections);
72 
73  private:
81  float processDetection(const cv::Mat& frame, core::Detection& detection);
82 
83  std::vector<core::Detection> mPerviousDetections;
84  long long mTrackingIdCounter = 0;
85  };
86  } // namespace face
87 } // namespace core
This file contains the NeuralBase class which serves as a base class for neural networks.
Definition: NeuralBase.h:20
A class responsible for initializing, configuring, and processing face mesh detection using neural ne...
Definition: FaceMesh.h:16
~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.
Definition: FaceMesh.cpp:11
void process(const cv::Mat &frame, std::vector< core::Detection > &detections)
Processes an input frame to detect face meshes.
Definition: FaceMesh.cpp:43
FaceMesh()=default
Default constructor for the FaceMesh class.
A structure to represent the detection details.
Definition: Detection.h:20