|
EmotiEffCppLib
Cpp implementation of Emotion Efficient Library
|
Torch backend implementation of the EmotiEffLibRecognizer. More...
#include <facial_analysis.h>


Public Member Functions | |
| EmotiEffLibRecognizerTorch (const EmotiEffLibConfig &config) | |
| Constructs an EmotiEffLibRecognizerOnnx instance with the specified configuration. | |
| EmotiEffLibRecognizerTorch (const std::string &fullPipelineModelPath) | |
| Constructs an EmotiEffLibRecognizerOnnx instance with the specified model path. | |
| EmotiEffLibRes | classifyEmotions (const xt::xarray< float > &features, bool logits=true) override |
| Classifies emotions based on extracted features. | |
| EmotiEffLibRes | classifyEngagement (const xt::xarray< float > &features) override |
| Classifies engagement based on extracted features. | |
| xt::xarray< float > | extractFeatures (const cv::Mat &faceImg) override |
| Extracts features from a single face image. | |
| EmotiEffLibRes | predictEmotions (const cv::Mat &faceImg, bool logits=true) override |
| Predicts emotions for a single face image. | |
| EmotiEffLibRes | predictEngagement (const std::vector< cv::Mat > &faceImgs) override |
| Predicts engagement for a sequence of face images. | |
| Public Member Functions inherited from EmotiEffLib::EmotiEffLibRecognizer | |
| virtual | ~EmotiEffLibRecognizer ()=default |
| virtual xt::xarray< float > | extractFeatures (const std::vector< cv::Mat > &faceImgs) |
| Extracts features from a sequence of face images. | |
| std::string | getEmotionClassById (int idx) |
| Gets the emotion class name by index. | |
| std::string | getEngagementClassById (int idx) |
| Gets the engagement class name by index. | |
| virtual EmotiEffLibRes | predictEmotions (const std::vector< cv::Mat > &faceImgs, bool logits=true) |
| Predicts emotions for a sequence of face images. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from EmotiEffLib::EmotiEffLibRecognizer | |
| static std::unique_ptr< EmotiEffLibRecognizer > | createInstance (const EmotiEffLibConfig &config) |
| Creates an instance of the EmotiEffLibRecognizer with the specified configuration. | |
| static std::unique_ptr< EmotiEffLibRecognizer > | createInstance (const std::string &backend, const std::string &fullPipelineModelPath) |
| Creates an instance of the EmotiEffLibRecognizer with the specified backend and model path. | |
| Protected Member Functions inherited from EmotiEffLib::EmotiEffLibRecognizer | |
| xt::xarray< float > | engagementFeaturesPreprocess (const xt::xarray< float > features) |
| Preprocesses engagement features. | |
| EmotiEffLibRes | processEmotionScores (const xt::xarray< float > &scores, bool logits) |
| Common method to processes emotion scores and generate classification results. | |
| EmotiEffLibRes | processEngagementScores (const xt::xarray< float > &scores) |
| Common method to processes engagement scores and generate classification results. | |
| Protected Attributes inherited from EmotiEffLib::EmotiEffLibRecognizer | |
| int | classifierIdx_ = -1 |
| Index of the classifier model in the array with models. | |
| int | engagementClassifierIdx_ = -1 |
| Index of the engagement classifier model in the array with models. | |
| const int | engagementSlidingWindowSize_ = 128 |
| Sliding window size for engagement prediction. | |
| int | featureExtractorIdx_ = -1 |
| Index of the model for features extraction in the array with models. | |
| int | fullPipelineModelIdx_ = -1 |
| Index of the full pipeline model in the array with models. | |
| std::vector< std::string > | idxToEmotionClass_ |
| Emotion class names. | |
| std::vector< std::string > | idxToEngagementClass_ = {"Distracted", "Engaged"} |
| Engagement class names. | |
| int | imgSize_ |
| Input image size. | |
| bool | isMtl_ |
| Whether the model is multi-task learning (MTL). | |
| std::string | modelName_ = "" |
| Name of the model. | |
Torch backend implementation of the EmotiEffLibRecognizer.
This class provides the Torch-specific implementation for emotion and engagement recognition.
Definition at line 20 of file facial_analysis.h.
| EmotiEffLib::EmotiEffLibRecognizerTorch::EmotiEffLibRecognizerTorch | ( | const std::string & | fullPipelineModelPath | ) |
Constructs an EmotiEffLibRecognizerOnnx instance with the specified model path.
| fullPipelineModelPath | Path to the full pipeline emotion recognition ONNX model. |
Definition at line 50 of file facial_analysis.cpp.
| EmotiEffLib::EmotiEffLibRecognizerTorch::EmotiEffLibRecognizerTorch | ( | const EmotiEffLibConfig & | config | ) |
Constructs an EmotiEffLibRecognizerOnnx instance with the specified configuration.
| config | The configuration structure. |
Definition at line 59 of file facial_analysis.cpp.
|
overridevirtual |
Classifies emotions based on extracted features.
| features | The extracted features. |
| logits | Whether to return raw logits or apply softmax. |
Implements EmotiEffLib::EmotiEffLibRecognizer.
Definition at line 74 of file facial_analysis.cpp.
|
overridevirtual |
Classifies engagement based on extracted features.
| features | The extracted features. |
Implements EmotiEffLib::EmotiEffLibRecognizer.
Definition at line 85 of file facial_analysis.cpp.
|
overridevirtual |
Extracts features from a single face image.
| faceImg | The input face image. |
Implements EmotiEffLib::EmotiEffLibRecognizer.
Definition at line 64 of file facial_analysis.cpp.
|
overridevirtual |
Predicts emotions for a single face image.
| faceImg | The input face image. |
| logits | Whether to return raw logits or apply softmax. |
Implements EmotiEffLib::EmotiEffLibRecognizer.
Definition at line 104 of file facial_analysis.cpp.
|
overridevirtual |
Predicts engagement for a sequence of face images.
| faceImgs | A list of input face images. |
Implements EmotiEffLib::EmotiEffLibRecognizer.
Definition at line 123 of file facial_analysis.cpp.