Hello everyone,
I have built a few models on the nRF5340 DK, possibly more than two, and I want to run them on the board. I followed this tutorial: Run Multiple Impulses in C++. It should work manually on my local setup, but I didn’t understand the following instructions:
Merge the variables and structs in
model_variables.h
Copy the necessary variables and structs from previously updatedimage/model_metadata.h
file content to themerged-impulse/model_metadata.h
.
To do so, include both of these lines in the#include
section:#include "tflite-model/trained_model_compiled_audio.h" #include "tflite-model/trained_model_compiled_image.h" The section that should be copied is from `const char* ei_classifier_inferencing_categories...` to the line before `const ei_impulse_t ei_default_impulse = impulse_<ProjectID>_<version>`. Make sure to leave only one `const ei_impulse_t ei_default_impulse = impulse_233502_3;` — this will define which of your impulses is the default one.
I don’t understand this part. In my downloaded Edge Impulse C++ library:
-
const char* ei_classifier_inferencing_categories
exists inmodel_variables.h
, but not inmodel_metadata.h
. - I’m unsure which parts of
model_metadata.h
andmodel_variables.h
should be merged, and where exactly they should go inmerged-impulse/model_metadata.h
.
Additionally, after merging, I want to put my files into this project: Example Standalone Inferencing for Zephyr and run it. But in main.cpp
there is only one feature array. How can I feed input data to two different models?
Could someone provide a step-by-step example of how to:
- Merge
model_variables.h
andmodel_metadata.h
from multiple models. - Choose the default impulse while keeping the others accessible.
- Modify
main.cpp
to run inference on multiple models, possibly using the same input data.
Any guidance, code snippets, or references would be greatly appreciated