Skip to main content
Public-facing structs for Edge Impulse C++ SDK.

ei_impulse_result_classification_t

Holds the output of inference, anomaly results, and timing information. ei_impulse_result_t holds the output of run_classifier(). If object detection is enabled, then the output results is a pointer to an array of bounding boxes of size bounding_boxes_count, as given by ei_impulse_result_bounding_box_t. Otherwise, results are stored as an array of classification scores, as given by ei_impulse_result_classification_t. If anomaly detection is enabled (e.g. EI_CLASSIFIER_HAS_ANOMALY == 1), then the anomaly score will be stored as a floating point value in anomaly. Timing information is stored in an ei_impulse_result_timing_t struct. Source: classifier/ei_classifier_types.h Example: standalone inferencing main.cpp

ei_impulse_visual_ad_result_t

Holds the output of visual anomaly detection (FOMO-AD) If visual anomaly detection is enabled (e.g. EI_CLASSIFIER_HAS_VISUAL_ANOMALY == 1), then the output results will be a pointer to an array of grid cells of size visual_ad_count, as given by ei_impulse_result_bounding_box_t. The visual anomaly detection result is stored in visual_ad_result, which contains the mean and max values of the grid cells. Source: classifier/ei_classifier_types.h Example: standalone inferencing main.cpp

ei_impulse_result_bounding_box_t

Holds information for a single bounding box. If object detection is enabled (i.e. EI_CLASSIFIER_OBJECT_DETECTION == 1), then inference results will be one or more bounding boxes. The bounding boxes with the highest confidence scores (assuming those scores are equal to or greater than EI_CLASSIFIER_OBJECT_DETECTION_THRESHOLD), given by the value member, are returned from inference. The total number of bounding boxes returned will be at least EI_CLASSIFIER_OBJECT_DETECTION_COUNT. The exact number of bounding boxes is stored in bounding_boxes_count field of [ei_impulse_result_t]/C++ Inference SDK Library/structs/ei_impulse_result_t.md). A bounding box is a rectangle that ideally surrounds the identified object. The (x, y) coordinates in the struct identify the top-left corner of the box. label is the predicted class with the highest confidence score. value is the confidence score between [0.0..1.0] of the given label. Source: classifier/ei_classifier_types.h Example: standalone inferencing main.cpp

ei_impulse_result_timing_t

Holds timing information about the processing (DSP) and inference blocks. Records timing information during the execution of the preprocessing (DSP) and inference blocks. Can be used to determine if inference will meet timing requirements on your particular platform. Source: classifier/ei_classifier_types.h Example: standalone inferencing main.cpp

ei_impulse_result_t

Holds the output of inference, anomaly results, and timing information. ei_impulse_result_t holds the output of run_classifier(). If object detection is enabled (e.g. EI_CLASSIFIER_OBJECT_DETECTION == 1), then the output results is a pointer to an array of bounding boxes of size bounding_boxes_count, as given by ei_impulse_result_bounding_box_t. Otherwise, results are stored as an array of classification scores, as given by ei_impulse_result_classification_t. If anomaly detection is enabled (e.g. EI_CLASSIFIER_HAS_ANOMALY == 1), then the anomaly score will be stored as a floating point value in anomaly. Timing information is stored in an ei_impulse_result_timing_t struct. Source: classifier/ei_classifier_types.h Example: standalone inferencing main.cpp

ei_signal_t

Holds the callback pointer for retrieving raw data and the length of data to be retrieved. Holds the callback function, get_data(size_t offset, size_t length, float *out_ptr). This callback should be implemented by the user and fills the memory location given by *out_ptr with raw features. Features must be flattened to a 1-dimensional vector, as described in this guide. get_data() may be called multiple times during preprocessing or inference (e.g. during execution of run_classifier() or run_classifier_continuous()). The offset argument will update to point to new data, and length data must be copied into the location specified by out_ptr. This scheme allows raw features to be stored in RAM or flash memory and paged in as necessary. Note that get_data() (even after multiple calls during a single execution of run_classifier() or run_classifier_continuous()) will never request more than a total number of features as given by total_length. Source: dsp/numpy_types.h Example: standalone inferencing main.cpp