Skip to content

Commit

Permalink
SDK release v1.66.3
Browse files Browse the repository at this point in the history
  • Loading branch information
francovaro committed Jan 3, 2025
1 parent a02fc80 commit 7bec348
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 87 deletions.
14 changes: 7 additions & 7 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.65.0/</url>
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.66.3/</url>
<supportContact>[email protected]</supportContact>
<repository type="git">https://github.com/edgeimpulse/edge-impulse-sdk-pack.git</repository>
<releases>
<release version="1.65.0" tag="v1.65.0" date="2024-12-20" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.65.0/EdgeImpulse.EI-SDK.1.65.0.pack">
<release version="1.66.3" tag="v1.66.3" date="2025-01-03" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.66.3/EdgeImpulse.EI-SDK.1.66.3.pack">
EI-SDK
</release>
<release version="1.65.0" tag="v1.65.0" date="2024-12-20" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.65.0/EdgeImpulse.EI-SDK.1.65.0.pack">
EI-SDK
</release>
<release version="1.64.4" tag="v1.64.4" date="2024-12-19" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.64.4/EdgeImpulse.EI-SDK.1.64.4.pack">
EI-SDK
</release>
Expand Down Expand Up @@ -98,9 +101,6 @@
</release>
<release version="1.52.11" tag="v1.52.11" date="2024-06-25" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.52.11/EdgeImpulse.EI-SDK.1.52.11.pack">
EI-SDK
</release>
<release version="1.52.10" tag="v1.52.10" date="2024-06-24" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.52.10/EdgeImpulse.EI-SDK.1.52.10.pack">
EI-SDK
</release>
</releases>
<keywords>
Expand Down Expand Up @@ -146,7 +146,7 @@
</packages>
</requirements>
<components>
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.65.0">
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.66.3">
<description>Edge Impulse SDK</description>
<!-- short component description -->
<files>
Expand Down Expand Up @@ -387,7 +387,6 @@
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_signal_with_range.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_fill_result_struct.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_model_types.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/sdk_version.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_classifier_smooth.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_signal_with_axes.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/anomaly.h"/>
Expand All @@ -400,6 +399,7 @@
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/tflite_full.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/ethos_linux.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/tflite_helper.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/aton.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/tflite_micro.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/tensaiflow.h"/>
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/memryx.h"/>
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-12-20 15:34:16</timestamp>
<timestamp>2025-01-03 12:23:57</timestamp>
<pindex>
<pdsc url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.65.0/" vendor="EdgeImpulse" name="EI-SDK" version="1.65.0"/>
<pdsc url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.66.3/" vendor="EdgeImpulse" name="EI-SDK" version="1.66.3"/>
</pindex>
</index>
1 change: 1 addition & 0 deletions edgeimpulse/edge-impulse-sdk/classifier/ei_model_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#define EI_CLASSIFIER_ONNX_TIDL 11
#define EI_CLASSIFIER_MEMRYX 12
#define EI_CLASSIFIER_ETHOS_LINUX 13
#define EI_CLASSIFIER_ATON 14

#define EI_CLASSIFIER_SENSOR_UNKNOWN -1
#define EI_CLASSIFIER_SENSOR_MICROPHONE 1
Expand Down
19 changes: 6 additions & 13 deletions edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define _EDGE_IMPULSE_RUN_CLASSIFIER_H_

#include "ei_model_types.h"
#include "sdk_version.h"
#include "model-parameters/model_metadata.h"

#include "ei_run_dsp.h"
Expand Down Expand Up @@ -61,21 +60,14 @@
#include "edge-impulse-sdk/classifier/inferencing_engines/memryx.h"
#elif EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ETHOS_LINUX
#include "edge-impulse-sdk/classifier/inferencing_engines/ethos_linux.h"
#elif EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ATON
#include "edge-impulse-sdk/classifier/inferencing_engines/aton.h"
#elif EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_NONE
// noop
#else
#error "Unknown inferencing engine"
#endif

// strictly require sdk version and studio version macros to match
#if EI_SDK_VERSION_MAJOR != EI_STUDIO_VERSION_MAJOR || EI_SDK_VERSION_MINOR != EI_STUDIO_VERSION_MINOR || EI_SDK_VERSION_PATCH != EI_STUDIO_VERSION_PATCH
#if EI_SDK_VERSION_MAJOR == 0
#pragma message "SDK version not set."
#else
#error "Version mismatch between edge-impulse-sdk and the model (model-parameters and tflite-model). Make sure you use the same version for both. Advised to download the deployment files again from Edge Impulse."
#endif
#endif

// This file has an implicit dependency on ei_run_dsp.h, so must come after that include!
#include "model-parameters/model_variables.h"

Expand Down Expand Up @@ -246,7 +238,7 @@ extern "C" EI_IMPULSE_ERROR process_impulse(ei_impulse_handle_t *handle,
return EI_IMPULSE_INFERENCE_ERROR;
}

#if (EI_CLASSIFIER_QUANTIZATION_ENABLED == 1 && (EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TFLITE || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TENSAIFLOW || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ONNX_TIDL)) || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_DRPAI
#if (EI_CLASSIFIER_QUANTIZATION_ENABLED == 1 && (EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TFLITE || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TENSAIFLOW || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ONNX_TIDL) || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_DRPAI || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ATON)
// Shortcut for quantized image models
ei_learning_block_t block = handle->impulse->learning_blocks[0];
if (can_run_classifier_image_quantized(handle->impulse, block) == EI_IMPULSE_OK) {
Expand Down Expand Up @@ -605,7 +597,8 @@ __attribute__((unused)) static EI_IMPULSE_ERROR can_run_classifier_image_quantiz
if (impulse->inferencing_engine != EI_CLASSIFIER_TFLITE
&& impulse->inferencing_engine != EI_CLASSIFIER_TENSAIFLOW
&& impulse->inferencing_engine != EI_CLASSIFIER_DRPAI
&& impulse->inferencing_engine != EI_CLASSIFIER_ONNX_TIDL) // check later
&& impulse->inferencing_engine != EI_CLASSIFIER_ONNX_TIDL
&& impulse->inferencing_engine != EI_CLASSIFIER_ATON) // check later
{
return EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
}
Expand Down Expand Up @@ -634,7 +627,7 @@ __attribute__((unused)) static EI_IMPULSE_ERROR can_run_classifier_image_quantiz
return EI_IMPULSE_OK;
}

#if EI_CLASSIFIER_QUANTIZATION_ENABLED == 1 && (EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TFLITE || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TENSAIFLOW || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_DRPAI || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ONNX_TIDL)
#if EI_CLASSIFIER_QUANTIZATION_ENABLED == 1 && (EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TFLITE || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_TENSAIFLOW || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_DRPAI || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ONNX_TIDL || EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ATON)

/**
* Special function to run the classifier on images, only works on TFLite models (either interpreter, EON, tensaiflow, drpai, tidl, memryx)
Expand Down
174 changes: 174 additions & 0 deletions edgeimpulse/edge-impulse-sdk/classifier/inferencing_engines/aton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/*
* Copyright (c) 2024 EdgeImpulse Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef _EI_CLASSIFIER_INFERENCING_ENGINE_ATON_H

#if (EI_CLASSIFIER_INFERENCING_ENGINE == EI_CLASSIFIER_ATON)

/* Include ----------------------------------------------------------------- */
#include "edge-impulse-sdk/tensorflow/lite/kernels/custom/tree_ensemble_classifier.h"
#include "edge-impulse-sdk/classifier/ei_fill_result_struct.h"
#include "edge-impulse-sdk/classifier/ei_model_types.h"
#include "edge-impulse-sdk/classifier/ei_run_dsp.h"
#include "edge-impulse-sdk/porting/ei_logging.h"

#include "ll_aton_runtime.h"
#include "app_config.h"

/* Private variables ------------------------------------------------------- */
static uint8_t *nn_in;
static uint8_t *nn_out;

static const LL_Buffer_InfoTypeDef *nn_in_info;
static const LL_Buffer_InfoTypeDef *nn_out_info;

LL_ATON_DECLARE_NAMED_NN_INSTANCE_AND_INTERFACE(Default);


EI_IMPULSE_ERROR run_nn_inference_image_quantized(
const ei_impulse_t *impulse,
signal_t *signal,
ei_impulse_result_t *result,
void *config_ptr,
bool debug = false)
{
EI_IMPULSE_ERROR fill_res = EI_IMPULSE_OK;
extern uint8_t *global_camera_buffer;
extern uint8_t *snapshot_buf;
// this needs to be changed for multi-model, multi-impulse
static bool first_run = true;

uint64_t ctx_start_us = ei_read_timer_us();

#if DATA_OUT_FORMAT_FLOAT32
static float32_t *nn_out;
#else
static uint8_t *nn_out;
#endif
static uint32_t nn_out_len;

if(first_run == true) {

nn_in_info = LL_ATON_Input_Buffers_Info_Default();
nn_out_info = LL_ATON_Output_Buffers_Info_Default();

nn_in = (uint8_t *) nn_in_info[0].addr_start.p;
uint32_t nn_in_len = LL_Buffer_len(&nn_in_info[0]);
nn_out = (uint8_t *) nn_out_info[0].addr_start.p;


#if DATA_OUT_FORMAT_FLOAT32
nn_out = (float32_t *) nn_out_info[0].addr_start.p;
#else
nn_out = (uint8_t *) nn_out_info[0].addr_start.p;
#endif
nn_out_len = LL_Buffer_len(&nn_out_info[0]);

first_run = false;
}

memcpy(nn_in, snapshot_buf, impulse->input_width * impulse->input_height * 3);
#ifdef USE_DCACHE
SCB_CleanInvalidateDCache_by_Addr(nn_in, impulse->input_width * impulse->input_height * 3);
#endif

LL_ATON_RT_Main(&NN_Instance_Default);

#ifdef USE_DCACHE
SCB_CleanInvalidateDCache_by_Addr(nn_out, nn_out_len);
#endif

ei_learning_block_config_tflite_graph_t *block_config = (ei_learning_block_config_tflite_graph_t *)impulse->learning_blocks[0].config;
if (block_config->classification_mode == EI_CLASSIFIER_CLASSIFICATION_MODE_OBJECT_DETECTION) {
switch (block_config->object_detection_last_layer) {

case EI_CLASSIFIER_LAST_LAYER_YOLOV5:
#if MODEL_OUTPUT_IS_FLOAT
fill_res = fill_result_struct_f32_yolov5(
ei_default_impulse.impulse,
&result,
6, // hard coded for now
(float *)&data,//output.data.uint8,
// output.params.zero_point,
// output.params.scale,
ei_default_impulse.impulse->tflite_output_features_count);
#else
fill_res = fill_result_struct_quantized_yolov5(
impulse,
block_config,
result,
6, // hard coded for now
(uint8_t *)nn_out,
nn_out_info[0].offset[0],
nn_out_info[0].scale[0],
nn_out_len);
#endif
break;

case EI_CLASSIFIER_LAST_LAYER_FOMO:
fill_res = fill_result_struct_i8_fomo(
impulse,
block_config,
result,
(int8_t *)nn_out,
nn_out_info[0].offset[0],
nn_out_info[0].scale[0],
impulse->fomo_output_size,
impulse->fomo_output_size);
break;

default:
ei_printf("ERR: Unsupported object detection last layer (%d)\n",
block_config->object_detection_last_layer);
fill_res = EI_IMPULSE_UNSUPPORTED_INFERENCING_ENGINE;
break;
}

}

result->timing.classification_us = ei_read_timer_us() - ctx_start_us;

return fill_res;
}


/**
* @brief Do neural network inferencing over the processed feature matrix
*
* @param fmatrix Processed matrix
* @param result Output classifier results
* @param[in] debug Debug output enable
*
* @return The ei impulse error.
*/
EI_IMPULSE_ERROR run_nn_inference(
const ei_impulse_t *impulse,
ei_feature_t *fmatrix,
uint32_t learn_block_index,
uint32_t* input_block_ids,
uint32_t input_block_ids_size,
ei_impulse_result_t *result,
void *config_ptr,
bool debug = false)
{


return EI_IMPULSE_OK;
}

#endif // EI_CLASSIFIER_INFERENCING_ENGINE
#endif // _EI_CLASSIFIER_INFERENCING_ENGINE_ATON_H
42 changes: 0 additions & 42 deletions edgeimpulse/edge-impulse-sdk/classifier/sdk_version.h

This file was deleted.

2 changes: 1 addition & 1 deletion edgeimpulse/edge-impulse-sdk/dsp/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// clang-format off
#ifndef EIDSP_USE_CMSIS_DSP // __ARM_ARCH_PROFILE is a predefine of arm-gcc. __TARGET_* is armcc
#if defined(__MBED__) || __ARM_ARCH_PROFILE == 'M' || defined(__TARGET_CPU_CORTEX_M0) || defined(__TARGET_CPU_CORTEX_M0PLUS) || defined(__TARGET_CPU_CORTEX_M3) || defined(__TARGET_CPU_CORTEX_M4) || defined(__TARGET_CPU_CORTEX_M7) || defined(USE_HAL_DRIVER) || defined(ARDUINO_NRF52_ADAFRUIT)
#if (defined(__MBED__) || __ARM_ARCH_PROFILE == 'M' || defined(__TARGET_CPU_CORTEX_M0) || defined(__TARGET_CPU_CORTEX_M0PLUS) || defined(__TARGET_CPU_CORTEX_M3) || defined(__TARGET_CPU_CORTEX_M4) || defined(__TARGET_CPU_CORTEX_M7) || defined(USE_HAL_DRIVER) || defined(ARDUINO_NRF52_ADAFRUIT)) && !defined(EI_PORTING_STM32_CUBEAI)
// Mbed OS versions before 5.7 are not based on CMSIS5, disable CMSIS-DSP and CMSIS-NN instructions
#if defined(__MBED__)
#include "mbed_version.h"
Expand Down
6 changes: 6 additions & 0 deletions edgeimpulse/edge-impulse-sdk/dsp/numpy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
#define __has_include 1
#endif // __has_include

// Arduino build defines abs as a macro. That is invalid C++, and breaks
// libc++'s <complex> header, undefine it.
#ifdef abs
#undef abs
#endif

#include <stdint.h>
#include <string.h>
#include <stddef.h>
Expand Down
Loading

0 comments on commit 7bec348

Please sign in to comment.