diff --git a/EdgeImpulse.EI-SDK.pdsc b/EdgeImpulse.EI-SDK.pdsc index f56a358..9def10a 100644 --- a/EdgeImpulse.EI-SDK.pdsc +++ b/EdgeImpulse.EI-SDK.pdsc @@ -5,13 +5,16 @@ EI-SDK LICENSE-apache-2.0.txt Edge Impulse SDK - https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.66.3/ + https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.66.14/ hello@edgeimpulse.com https://github.com/edgeimpulse/edge-impulse-sdk-pack.git - + EI-SDK + + EI-SDK + EI-SDK @@ -98,9 +101,6 @@ EI-SDK - - - EI-SDK @@ -146,7 +146,7 @@ - + Edge Impulse SDK diff --git a/EdgeImpulse.pidx b/EdgeImpulse.pidx index 50b12e3..7db2678 100644 --- a/EdgeImpulse.pidx +++ b/EdgeImpulse.pidx @@ -2,8 +2,8 @@ EdgeImpulse https://raw.githubusercontent.com/edgeimpulse/edge-impulse-sdk-pack/main/ - 2025-01-03 12:23:57 + 2025-01-13 17:34:49 - + diff --git a/edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier.h b/edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier.h index 60f4141..cb95678 100644 --- a/edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier.h +++ b/edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier.h @@ -102,13 +102,13 @@ therefore changes are allowed. */ __attribute__((unused)) void display_results(ei_impulse_handle_t *handle, ei_impulse_result_t* result) { // print the predictions - ei_printf("Timing: DSP "); + ei_printf("Predictions (DSP: "); result->timing.dsp_us ? ei_printf_float((float)result->timing.dsp_us/1000) : ei_printf("%d", result->timing.dsp); - ei_printf(" ms, inference "); + ei_printf(" ms., Classification: "); result->timing.classification_us ? ei_printf_float((float)result->timing.classification_us/1000) : ei_printf("%d", result->timing.classification); - ei_printf(" ms, anomaly "); + ei_printf(" ms., Anomaly: "); result->timing.anomaly_us ? ei_printf_float((float)result->timing.anomaly_us/1000) : ei_printf("%d", result->timing.anomaly); - ei_printf(" ms\r\n"); + ei_printf("ms.): \n"); #if EI_CLASSIFIER_OBJECT_DETECTION == 1 ei_printf("#Object detection results:\r\n"); diff --git a/edgeimpulse/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h b/edgeimpulse/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h index 2fd4b5b..4741c51 100644 --- a/edgeimpulse/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h +++ b/edgeimpulse/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h @@ -50,6 +50,8 @@ namespace fft { */ static int cmsis_rfft_init_f32(arm_rfft_fast_instance_f32 *rfft_instance, const size_t n_fft) { +// ARM now has functions that can do this for you...and it may work for for Helium as well +// https://github.com/ARM-software/CMSIS-DSP/issues/179 // ARM cores (ex M55) with Helium extensions (MVEF) need special treatment (Issue 2843) #if EI_CLASSIFIER_HAS_FFT_INFO == 1 && !defined(ARM_MATH_MVEF) && \ !defined(EI_CLASSIFIER_LOAD_ALL_FFTS) diff --git a/edgeimpulse/edge-impulse-sdk/dsp/numpy.hpp b/edgeimpulse/edge-impulse-sdk/dsp/numpy.hpp index f05913e..06163ea 100644 --- a/edgeimpulse/edge-impulse-sdk/dsp/numpy.hpp +++ b/edgeimpulse/edge-impulse-sdk/dsp/numpy.hpp @@ -1333,25 +1333,18 @@ class numpy { src_size = n_fft; } - // declare input and output arrays - float *fft_input_buffer = NULL; - if (src_size >= n_fft) { // technically they can only be equal or src < n_fft, b/c of step above - fft_input_buffer = (float*)src; - } // else we need to copy over and pad - - // If fft_input_buffer is NULL (see above), then the constructor will allocate a new buffer - EI_DSP_MATRIX_B(fft_input, 1, n_fft, fft_input_buffer); + // Unfortunately, arm fft (at least) modifies the input buffer AND does not work in place + // So we have to copy the input to a new buffer + EI_DSP_MATRIX(fft_input, 1, n_fft); if (!fft_input.buffer) { EIDSP_ERR(EIDSP_OUT_OF_MEM); } // If the buffer wasn't assigned to source above, let's copy and pad - if (!fft_input_buffer) { - // copy from src to fft_input - memcpy(fft_input.buffer, src, src_size * sizeof(float)); - // pad to the rigth with zeros - memset(fft_input.buffer + src_size, 0, (n_fft - src_size) * sizeof(float)); - } + // copy from src to fft_input + memcpy(fft_input.buffer, src, src_size * sizeof(float)); + // pad to the rigth with zeros + memset(fft_input.buffer + src_size, 0, (n_fft - src_size) * sizeof(float)); auto res = ei::fft::hw_r2c_fft(fft_input.buffer, output, n_fft); if (handle_fft_hw_failure(res, n_fft)) {