Subject: Running Multiple Models on nRF5340 DK

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 updated image/model_metadata.h file content to the merged-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 in model_variables.h, but not in model_metadata.h.
  • I’m unsure which parts of model_metadata.h and model_variables.h should be merged, and where exactly they should go in merged-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:

  1. Merge model_variables.h and model_metadata.h from multiple models.
  2. Choose the default impulse while keeping the others accessible.
  3. Modify main.cpp to run inference on multiple models, possibly using the same input data.

Any guidance, code snippets, or references would be greatly appreciatedRun Multiple Impulses in C++