Skip to content

Commit

Permalink
SDK release v1.49.27
Browse files Browse the repository at this point in the history
  • Loading branch information
francovaro committed May 13, 2024
1 parent 396f530 commit 8cf74d1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 45 deletions.
9 changes: 6 additions & 3 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.49.23/</url>
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.27/</url>
<supportContact>[email protected]</supportContact>
<repository type="git">https://github.com/edgeimpulse/edge-impulse-sdk-pack.git</repository>
<releases>
<release version="1.49.23" tag="v1.49.23" date="2024-05-09" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.23/EdgeImpulse.EI-SDK.1.49.23.pack">
<release version="1.49.27" tag="v1.49.27" date="2024-05-13" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.27/EdgeImpulse.EI-SDK.1.49.27.pack">
EI-SDK
</release>
<release version="1.49.23" tag="v1.49.23" date="2024-05-09" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.23/EdgeImpulse.EI-SDK.1.49.23.pack">
EI-SDK
</release>
<release version="1.49.21" tag="v1.49.21" date="2024-05-03" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.21/EdgeImpulse.EI-SDK.1.49.21.pack">
EI-SDK
</release>
Expand Down Expand Up @@ -131,7 +134,7 @@
</packages>
</requirements>
<components>
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.49.23">
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.49.27">
<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-05-09 08:51:12</timestamp>
<timestamp>2024-05-13 11:16:32</timestamp>
<pindex>
<pdsc url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.23/" vendor="EdgeImpulse" name="EI-SDK" version="1.49.23"/>
<pdsc url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.27/" vendor="EdgeImpulse" name="EI-SDK" version="1.49.27"/>
</pindex>
</index>
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,11 @@ EI_IMPULSE_ERROR run_nn_inference_image_quantized(
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
}
case EI_CLASSIFIER_LAST_LAYER_YOLOV5_V5_DRPAI: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOv5 does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
if (debug) {
ei_printf("DEBUG: raw drpai output");
ei_printf("\n[");
Expand All @@ -725,14 +726,12 @@ EI_IMPULSE_ERROR run_nn_inference_image_quantized(
}
ei_printf("]\n");
}
}

#if ((EI_CLASSIFIER_OBJECT_DETECTION == 1) && (EI_CLASSIFIER_OBJECT_DETECTION_LAST_LAYER == EI_CLASSIFIER_LAST_LAYER_YOLOV5_V5_DRPAI))
// do post processing
fill_res = drpai_run_yolov5_postprocessing(impulse, block_config, signal, result, debug);
#endif

#endif

break;
}
default: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ static EI_IMPULSE_ERROR inference_onnx_run(const ei_impulse_t *impulse,
if (block_config->object_detection) {
switch (block_config->object_detection_last_layer) {
case EI_CLASSIFIER_LAST_LAYER_YOLOX: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOX does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else

}
else {
if (debug) {
ei_printf("YOLOX OUTPUT (%d ms.): ", result->timing.classification);
for (size_t ix = 0; ix < output_tensor_features_count; ix++) {
Expand All @@ -406,7 +406,7 @@ static EI_IMPULSE_ERROR inference_onnx_run(const ei_impulse_t *impulse,
result,
(float*)out_data,
output_tensor_features_count);
#endif
}
break;
}
default: {
Expand All @@ -417,7 +417,7 @@ static EI_IMPULSE_ERROR inference_onnx_run(const ei_impulse_t *impulse,
}
}
else {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
#if EI_CLASSIFIER_QUANTIZATION_ENABLED == 1

switch (output_tensor_type) {
case ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ EI_IMPULSE_ERROR run_nn_inference_image_quantized(
if (block_config->object_detection) {
switch (block_config->object_detection_last_layer) {
case EI_CLASSIFIER_LAST_LAYER_FOMO: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
fill_res = fill_result_struct_i8_fomo(
impulse,
block_config,
Expand All @@ -191,10 +191,11 @@ EI_IMPULSE_ERROR run_nn_inference_image_quantized(
graph_config->output_scale,
impulse->fomo_output_size,
impulse->fomo_output_size);
#else
}
else {
ei_printf("ERR: TensaiFlow does not support float32 inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#endif
}
break;
}
default: {
Expand All @@ -205,18 +206,19 @@ EI_IMPULSE_ERROR run_nn_inference_image_quantized(
}
}
else {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
fill_res = fill_result_struct_i8(
impulse,
result,
infer_result,
graph_config->output_zeropoint,
graph_config->output_scale,
debug);
#else
}
else {
ei_printf("ERR: TensaiFlow does not support float32 inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#endif
}
}

if (fill_res != EI_IMPULSE_OK) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,25 +388,27 @@ EI_IMPULSE_ERROR fill_result_struct_from_output_tensor_tflite(
break;
}
case EI_CLASSIFIER_LAST_LAYER_YOLOX: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOX does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
fill_res = fill_result_struct_f32_yolox(
impulse,
block_config,
result,
output->data.f,
impulse->tflite_output_features_count,
debug);
#endif
}
break;
}
case EI_CLASSIFIER_LAST_LAYER_YOLOV7: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOV7 does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
size_t output_feature_count = 1;
for (int ix = 0; ix < output->dims->size; ix++) {
output_feature_count *= output->dims->data[ix];
Expand All @@ -417,7 +419,7 @@ EI_IMPULSE_ERROR fill_result_struct_from_output_tensor_tflite(
result,
output->data.f,
output_feature_count);
#endif
}
break;
}
case EI_CLASSIFIER_LAST_LAYER_TAO_SSD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ EI_IMPULSE_ERROR run_nn_inference(
result->timing.classification_us = ctx_end_us - ctx_start_us;
result->timing.classification = (int)(result->timing.classification_us / 1000);

#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
#if EI_CLASSIFIER_QUANTIZATION_ENABLED == 1
int8_t* out_data = interpreter->typed_output_tensor<int8_t>(block_config->output_data_tensor);
#else
float* out_data = interpreter->typed_output_tensor<float>(block_config->output_data_tensor);
Expand Down Expand Up @@ -232,7 +232,6 @@ EI_IMPULSE_ERROR run_nn_inference(
}
ei_printf(")\n");
}

}
}

Expand All @@ -249,7 +248,8 @@ EI_IMPULSE_ERROR run_nn_inference(
if (block_config->object_detection) {
switch (block_config->object_detection_last_layer) {
case EI_CLASSIFIER_LAST_LAYER_FOMO: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
#if EI_CLASSIFIER_QUANTIZATION_ENABLED == 1
fill_res = fill_result_struct_i8_fomo(
impulse,
block_config,
Expand All @@ -259,15 +259,17 @@ EI_IMPULSE_ERROR run_nn_inference(
out_data->tflite_output_scale,
impulse->fomo_output_size,
impulse->fomo_output_size);
#else
#endif
}
else {
fill_res = fill_result_struct_f32_fomo(
impulse,
block_config,
result,
out_data,
impulse->fomo_output_size,
impulse->fomo_output_size);
#endif
}
break;
}
case EI_CLASSIFIER_LAST_LAYER_SSD: {
Expand All @@ -279,10 +281,11 @@ EI_IMPULSE_ERROR run_nn_inference(
if (!label_tensor) {
return EI_IMPULSE_LABEL_TENSOR_WAS_NULL;
}
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: MobileNet SSD does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
fill_res = fill_result_struct_f32_object_detection(
impulse,
block_config,
Expand All @@ -291,15 +294,16 @@ EI_IMPULSE_ERROR run_nn_inference(
scores_tensor,
label_tensor,
debug);
#endif
}
break;
}
case EI_CLASSIFIER_LAST_LAYER_YOLOV5:
case EI_CLASSIFIER_LAST_LAYER_YOLOV5_V5_DRPAI: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOv5 does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
int version = block_config->object_detection_last_layer == EI_CLASSIFIER_LAST_LAYER_YOLOV5_V5_DRPAI ?
5 : 6;
fill_res = fill_result_struct_f32_yolov5(
Expand All @@ -310,29 +314,31 @@ EI_IMPULSE_ERROR run_nn_inference(
out_data,
impulse->tflite_output_features_count,
debug);
#endif
}
break;
}
case EI_CLASSIFIER_LAST_LAYER_YOLOX: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOX does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
fill_res = fill_result_struct_f32_yolox(
impulse,
block_config,
result,
out_data,
impulse->tflite_output_features_count,
debug);
#endif
}
break;
}
case EI_CLASSIFIER_LAST_LAYER_YOLOV7: {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
if (block_config->quantized == 1) {
ei_printf("ERR: YOLOV7 does not support quantized inference\n");
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
#else
}
else {
TfLiteTensor *output = interpreter->output_tensor(0);
size_t output_feature_count = 1;
for (int ix = 0; ix < output->dims->size; ix++) {
Expand All @@ -344,7 +350,7 @@ EI_IMPULSE_ERROR run_nn_inference(
result,
output->data.f,
output_feature_count);
#endif
}
break;
}
default: {
Expand All @@ -355,7 +361,7 @@ EI_IMPULSE_ERROR run_nn_inference(
}
}
else {
#if EI_CLASSIFIER_TFLITE_OUTPUT_QUANTIZED == 1
#if EI_CLASSIFIER_QUANTIZATION_ENABLED == 1
fill_res = fill_result_struct_i8(impulse, result, out_data, out_data->tflite_output_zeropoint, out_data->tflite_output_scale, debug);
#else
fill_res = fill_result_struct_f32(impulse, result, out_data, debug);
Expand Down

0 comments on commit 8cf74d1

Please sign in to comment.