KanduAI SDK  1.1
Functions
emotion_c_api.h File Reference
#include "api_types.h"

Go to the source code of this file.

Functions

void * rf_emotion_init (const char *model_path, rf_error_type *error)
 
void rf_emotion_close (void *classifier_handle, rf_error_type *error)
 
int rf_emotion_classify_whole (void *classifier_handle, void *image_handle, int ymin, int xmin, int ymax, int xmax, rf_error_type *error)
 

Function Documentation

◆ rf_emotion_classify_whole()

int rf_emotion_classify_whole ( void *  classifier_handle,
void *  image_handle,
int  ymin,
int  xmin,
int  ymax,
int  xmax,
rf_error_type error 
)

Classify whole image's emotion (where the whole image is the face image after cropped)

Parameters
classifier_handleclassifier handle
image_handleimage handle (use image API to create)
erroroutput parameter to return an error details output: int which represents the face's emotion using the following mapping: denote the output emotion as: output_emotion and the mapping by emotions_table_by_indices: std::vector<std::string> emotions_table_by_indices = {std::string("angry"), std::string("disgust"), std::string("fear"), std::string("happy"), std::string("sad"), std::string("surprise"), std::string("neutral") }; So the output emotion as string is given by: emotions_table_by_indices.at(output_emotion)

◆ rf_emotion_close()

void rf_emotion_close ( void *  classifier_handle,
rf_error_type error 
)

Deletes emotion handle.

Parameters
classifier_handleclassifier handle for the emotion
erroroutput parameter to return an error details

◆ rf_emotion_init()

void* rf_emotion_init ( const char *  model_path,
rf_error_type error 
)

Initializes emotion handle.

Parameters
model_pathpath to the "emotion" model
erroroutput parameter to return an error details
Returns
emotion handle