Skip to content

Commit

Permalink
SDK release v1.53.12
Browse files Browse the repository at this point in the history
  • Loading branch information
francovaro committed Jul 10, 2024
1 parent 3efbb7a commit 1c0a9cf
Show file tree
Hide file tree
Showing 10 changed files with 278 additions and 205 deletions.
12 changes: 6 additions & 6 deletions EdgeImpulse.EI-SDK.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
<name>EI-SDK</name>
<license>LICENSE-apache-2.0.txt</license>
<description>Edge Impulse SDK</description>
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.7/</url>
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.12/</url>
<supportContact>[email protected]</supportContact>
<repository type="git">https://github.com/edgeimpulse/edge-impulse-sdk-pack.git</repository>
<releases>
<release version="1.53.7" tag="v1.53.7" date="2024-07-05" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.7/EdgeImpulse.EI-SDK.1.53.7.pack">
<release version="1.53.12" tag="v1.53.12" date="2024-07-10" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.12/EdgeImpulse.EI-SDK.1.53.12.pack">
EI-SDK
</release>
<release version="1.53.7" tag="v1.53.7" date="2024-07-05" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.7/EdgeImpulse.EI-SDK.1.53.7.pack">
EI-SDK
</release>
<release version="1.53.5" tag="v1.53.5" date="2024-07-03" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.5/EdgeImpulse.EI-SDK.1.53.5.pack">
EI-SDK
</release>
Expand Down Expand Up @@ -98,9 +101,6 @@
</release>
<release version="1.49.3" tag="v1.49.3" date="2024-04-09" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.3/EdgeImpulse.EI-SDK.1.49.3.pack">
EI-SDK
</release>
<release version="1.49.0" tag="v1.49.0" date="2024-04-03" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.0/EdgeImpulse.EI-SDK.1.49.0.pack">
EI-SDK
</release>
</releases>
<keywords>
Expand Down Expand Up @@ -146,7 +146,7 @@
</packages>
</requirements>
<components>
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.53.7">
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.53.12">
<description>Edge Impulse SDK</description>
<!-- short component description -->
<files>
Expand Down
4 changes: 2 additions & 2 deletions EdgeImpulse.pidx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>EdgeImpulse</vendor>
<url>https://raw.githubusercontent.com/edgeimpulse/edge-impulse-sdk-pack/main/</url>
<timestamp>2024-07-05 09:15:15</timestamp>
<timestamp>2024-07-10 16:14:04</timestamp>
<pindex>
<pdsc url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.7/" vendor="EdgeImpulse" name="EI-SDK" version="1.53.7"/>
<pdsc url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.53.12/" vendor="EdgeImpulse" name="EI-SDK" version="1.53.12"/>
</pindex>
</index>
73 changes: 39 additions & 34 deletions edgeimpulse/edge-impulse-sdk/classifier/ei_classifier_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@

/**
* @defgroup ei_structs Structs
*
*
* Public-facing structs for Edge Impulse C++ SDK.
*
*
* @addtogroup ei_structs
* @{
*/

/**
* @brief 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](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
* Otherwise, results are stored as an array of classification scores, as given by
* [ei_impulse_result_classification_t](https://docs.edgeimpulse.com/reference/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
*
* Timing information is stored in an
* [ei_impulse_result_timing_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_timing_t)
* struct.
*
*
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
*
*
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
*/
typedef struct {
Expand All @@ -70,16 +70,16 @@ typedef struct {

/**
* @brief 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
* 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](https://docs.edgeimpulse.com/reference/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](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
*
*
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
*/
typedef struct {
Expand All @@ -96,7 +96,7 @@ typedef struct {

/**
* @brief 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
Expand All @@ -105,20 +105,20 @@ typedef struct {
* 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
*
* 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](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
*
*
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
*/
typedef struct {
/**
* Pointer to a character array describing the associated class of the given
* bounding box. Taken from one of the elements of
* Pointer to a character array describing the associated class of the given
* bounding box. Taken from one of the elements of
* `ei_classifier_inferencing_categories[]`.
*/
const char *label;
Expand Down Expand Up @@ -151,19 +151,19 @@ typedef struct {

/**
* @brief 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](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
*
*
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
*/
typedef struct {
/**
* If using `run_impulse()` to perform sampling and inference, it is the amount of
* time (in milliseconds) it took to fetch raw samples. Not used for
* time (in milliseconds) it took to fetch raw samples. Not used for
* `run_classifier()`.
*/
int sampling;
Expand Down Expand Up @@ -203,23 +203,23 @@ typedef struct {

/**
* @brief 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](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
* [ei_impulse_result_bounding_box_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_bounding_box_t).
* Otherwise, results are stored as an array of classification scores, as given by
* [ei_impulse_result_classification_t](https://docs.edgeimpulse.com/reference/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](https://docs.edgeimpulse.com/reference/ei_impulse_result_timing_t)
*
* Timing information is stored in an
* [ei_impulse_result_timing_t](https://docs.edgeimpulse.com/reference/ei_impulse_result_timing_t)
* struct.
*
*
* **Source**: [classifier/ei_classifier_types.h](https://github.com/edgeimpulse/inferencing-sdk-cpp/blob/master/classifier/ei_classifier_types.h)
*
*
* **Example**: [standalone inferencing main.cpp](https://github.com/edgeimpulse/example-standalone-inferencing/blob/master/source/main.cpp)
*/
typedef struct {
Expand All @@ -238,13 +238,18 @@ typedef struct {
* Array of classification results. If object detection is enabled, this will be
* empty.
*/
#ifdef EI_DSP_RESULT_OVERRIDE
// For CI only. We will create the array to hold results
ei_impulse_result_classification_t* classification;
#else
#if EI_CLASSIFIER_LABEL_COUNT == 0
// EI_CLASSIFIER_LABEL_COUNT can be 0 for anomaly only models
// to prevent compiler warnings/errors, we need to have at least one element
ei_impulse_result_classification_t classification[1];
#else
ei_impulse_result_classification_t classification[EI_CLASSIFIER_LABEL_COUNT];
#endif
#endif // EI_CLASSIFIER_LABEL_COUNT == 0
#endif // EI_DSP_RESULT_OVERRIDE else

/**
* Anomaly score. If anomaly detection is not enabled, this will be 0. A higher
Expand Down
11 changes: 10 additions & 1 deletion edgeimpulse/edge-impulse-sdk/classifier/ei_fill_result_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,24 @@ __attribute__((unused)) static EI_IMPULSE_ERROR fill_result_struct_f32(const ei_
ei_impulse_result_t *result,
float *data,
bool debug) {
for (uint32_t ix = 0; ix < impulse->label_count; ix++) {
#ifdef EI_DSP_RESULT_OVERRIDE
uint32_t stop_count = EI_DSP_RESULT_OVERRIDE;
#else
uint32_t stop_count = impulse->label_count;
#endif
for (uint32_t ix = 0; ix < stop_count; ix++) {

float value = data[ix];

if (debug) {
ei_printf("%s:\t", impulse->categories[ix]);
ei_printf_float(value);
ei_printf("\n");
}
// For testing purposes, we will have more values than labels
#ifndef EI_DSP_RESULT_OVERRIDE
result->classification[ix].label = impulse->categories[ix];
#endif
result->classification[ix].value = value;
}

Expand Down
Loading

0 comments on commit 1c0a9cf

Please sign in to comment.