6#ifndef BACKENDS_ONNX_FACIAL_ANALYSIS_H
7#define BACKENDS_ONNX_FACIAL_ANALYSIS_H
11#include <onnxruntime_cxx_api.h>
84 void initRecognizer(
const std::string& modelPath)
override;
99 xt::xarray<float> preprocess(
const cv::Mat& img)
override;
108 std::vector<Ort::Value> modelRunWrapper(
int modelIdx,
const std::vector<Ort::Value>& inputs);
112 std::vector<float> mean_;
114 std::vector<float> std_;
116 Ort::Env env_ = {ORT_LOGGING_LEVEL_WARNING,
"EmotiEffLib"};
118 Ort::AllocatorWithDefaultOptions allocator_;
120 std::vector<Ort::Session> models_;
EmotiEffLibRes classifyEngagement(const xt::xarray< float > &features) override
Classifies engagement based on extracted features.
EmotiEffLibRes predictEngagement(const std::vector< cv::Mat > &faceImgs) override
Predicts engagement for a sequence of face images.
EmotiEffLibRes classifyEmotions(const xt::xarray< float > &features, bool logits=true) override
Classifies emotions based on extracted features.
xt::xarray< float > extractFeatures(const cv::Mat &faceImg) override
Extracts features from a single face image.
EmotiEffLibRecognizerOnnx(const std::string &fullPipelineModelPath)
Constructs an EmotiEffLibRecognizerOnnx instance with the specified model path.
EmotiEffLibRes predictEmotions(const cv::Mat &faceImg, bool logits=true) override
Predicts emotions for a single face image.
Base class for emotion and engagement recognition.
Header file for the EmotiEffLib library, providing emotion and engagement recognition functionality.
Configuration structure for the EmotiEffLibRecognizer.
Structure to store the results of EmotiEffLib.