28
28
29
29
/**
30
30
* @defgroup ei_structs Structs
31
- *
31
+ *
32
32
* Public-facing structs for Edge Impulse C++ SDK.
33
- *
33
+ *
34
34
* @addtogroup ei_structs
35
35
* @{
36
36
*/
37
37
38
38
/**
39
39
* @brief Holds the output of inference, anomaly results, and timing information.
40
- *
40
+ *
41
41
* `ei_impulse_result_t` holds the output of `run_classifier()`. If object detection is
42
42
* enabled, then the output results is a
43
43
* pointer to an array of bounding boxes of size `bounding_boxes_count`, as given by
44
44
* [ei_impulse_result_bounding_box_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
45
45
* Otherwise, results are stored as an array of classification scores, as given by
46
46
* [ei_impulse_result_classification_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_classification_t).
47
- *
47
+ *
48
48
* If anomaly detection is enabled (e.g. `EI_CLASSIFIER_HAS_ANOMALY == 1`), then the
49
49
* anomaly score will be stored as a floating point value in `anomaly`.
50
- *
51
- * Timing information is stored in an
50
+ *
51
+ * Timing information is stored in an
52
52
* [ei_impulse_result_timing_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_timing_t)
53
53
* struct.
54
- *
54
+ *
55
55
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
56
- *
56
+ *
57
57
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
58
58
*/
59
59
typedef struct {
@@ -70,16 +70,16 @@ typedef struct {
70
70
71
71
/**
72
72
* @brief Holds the output of visual anomaly detection (FOMO-AD)
73
- *
73
+ *
74
74
* If visual anomaly detection is enabled (e.g. `EI_CLASSIFIER_HAS_VISUAL_ANOMALY ==
75
- * 1`), then the output results will be a pointer to an array of grid cells of size
76
- * `visual_ad_count`, as given by
75
+ * 1`), then the output results will be a pointer to an array of grid cells of size
76
+ * `visual_ad_count`, as given by
77
77
* [ei_impulse_result_bounding_box_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
78
- *
78
+ *
79
79
* The visual anomaly detection result is stored in `visual_ad_result`, which contains the mean and max values of the grid cells.
80
- *
80
+ *
81
81
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
82
- *
82
+ *
83
83
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
84
84
*/
85
85
typedef struct {
@@ -96,7 +96,7 @@ typedef struct {
96
96
97
97
/**
98
98
* @brief Holds information for a single bounding box.
99
- *
99
+ *
100
100
* If object detection is enabled (i.e. `EI_CLASSIFIER_OBJECT_DETECTION == 1`), then
101
101
* inference results will be one or more bounding boxes. The bounding boxes with the
102
102
* highest confidence scores (assuming those scores are equal to or greater than
@@ -105,20 +105,20 @@ typedef struct {
105
105
* least `EI_CLASSIFIER_OBJECT_DETECTION_COUNT`. The exact number of bounding boxes
106
106
* is stored in `bounding_boxes_count` field of [ei_impulse_result_t]/C++ Inference
107
107
* SDK Library/structs/ei_impulse_result_t.md).
108
- *
109
- * A bounding box is a rectangle that ideally surrounds the identified object. The
108
+ *
109
+ * A bounding box is a rectangle that ideally surrounds the identified object. The
110
110
* (`x`, `y`) coordinates in the struct identify the top-left corner of the box.
111
111
* `label` is the predicted class with the highest confidence score. `value` is the
112
112
* confidence score between [0.0..1.0] of the given `label`.
113
- *
113
+ *
114
114
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
115
- *
115
+ *
116
116
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
117
117
*/
118
118
typedef struct {
119
119
/**
120
- * Pointer to a character array describing the associated class of the given
121
- * bounding box. Taken from one of the elements of
120
+ * Pointer to a character array describing the associated class of the given
121
+ * bounding box. Taken from one of the elements of
122
122
* `ei_classifier_inferencing_categories[]`.
123
123
*/
124
124
const char * label ;
@@ -151,19 +151,19 @@ typedef struct {
151
151
152
152
/**
153
153
* @brief Holds timing information about the processing (DSP) and inference blocks.
154
- *
154
+ *
155
155
* Records timing information during the execution of the preprocessing (DSP) and
156
156
* inference blocks. Can be used to determine if inference will meet timing requirements
157
157
* on your particular platform.
158
- *
158
+ *
159
159
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
160
- *
160
+ *
161
161
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
162
162
*/
163
163
typedef struct {
164
164
/**
165
165
* If using `run_impulse()` to perform sampling and inference, it is the amount of
166
- * time (in milliseconds) it took to fetch raw samples. Not used for
166
+ * time (in milliseconds) it took to fetch raw samples. Not used for
167
167
* `run_classifier()`.
168
168
*/
169
169
int sampling ;
@@ -203,23 +203,23 @@ typedef struct {
203
203
204
204
/**
205
205
* @brief Holds the output of inference, anomaly results, and timing information.
206
- *
206
+ *
207
207
* `ei_impulse_result_t` holds the output of `run_classifier()`. If object detection is
208
208
* enabled (e.g. `EI_CLASSIFIER_OBJECT_DETECTION == 1`), then the output results is a
209
209
* pointer to an array of bounding boxes of size `bounding_boxes_count`, as given by
210
- * [ei_impulse_result_bounding_box_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
210
+ * [ei_impulse_result_bounding_box_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
211
211
* Otherwise, results are stored as an array of classification scores, as given by
212
212
* [ei_impulse_result_classification_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_classification_t).
213
- *
213
+ *
214
214
* If anomaly detection is enabled (e.g. `EI_CLASSIFIER_HAS_ANOMALY == 1`), then the
215
215
* anomaly score will be stored as a floating point value in `anomaly`.
216
- *
217
- * Timing information is stored in an
218
- * [ei_impulse_result_timing_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_timing_t)
216
+ *
217
+ * Timing information is stored in an
218
+ * [ei_impulse_result_timing_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_timing_t)
219
219
* struct.
220
- *
220
+ *
221
221
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
222
- *
222
+ *
223
223
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
224
224
*/
225
225
typedef struct {
@@ -238,13 +238,18 @@ typedef struct {
238
238
* Array of classification results. If object detection is enabled, this will be
239
239
* empty.
240
240
*/
241
+ #ifdef EI_DSP_RESULT_OVERRIDE
242
+ // For CI only. We will create the array to hold results
243
+ ei_impulse_result_classification_t * classification ;
244
+ #else
241
245
#if EI_CLASSIFIER_LABEL_COUNT == 0
242
246
// EI_CLASSIFIER_LABEL_COUNT can be 0 for anomaly only models
243
247
// to prevent compiler warnings/errors, we need to have at least one element
244
248
ei_impulse_result_classification_t classification [1 ];
245
249
#else
246
250
ei_impulse_result_classification_t classification [EI_CLASSIFIER_LABEL_COUNT ];
247
- #endif
251
+ #endif // EI_CLASSIFIER_LABEL_COUNT == 0
252
+ #endif // EI_DSP_RESULT_OVERRIDE else
248
253
249
254
/**
250
255
* Anomaly score. If anomaly detection is not enabled, this will be 0. A higher
0 commit comments