Arduino Sketch like OpenMV

I noticed for OpenMV you can download a and the model and a labels files, However with Arduino EdgeImpulse only allows direct install or a full library.

Any chance in the future of generating a sketch of the Arduino code with tab loadable files for the:, model.h and labels?

Not sure if I want to install a library for every single model I make, does that make sense?

Hi @Rocksetta, we can do this on OpenMV because all DSP code (to reduce color depth and to quantize pictures) and code to run the Neural Networks is baked into the firmware; this is not the case on Arduino, so we need the full library of DSP + ML code to make it run.

1 Like

Similar situation. After my model has been built, I have not yet found a way to download the raw Keras/tflite models or the C header file. Looking in the libraries it looks like your Arduino code doesn’t use a c header.h file but a kind of listing of the actual model weights, sort of a JSON file. Is there the ability to download the model in other formats?

Yes, go to Dashboard > Download block output and you can find your trained model there (in TF SavedModel and TFLite format).

1 Like

My bad, I should have seen that. Mind if I put in a request for EdgeImpulse to go that one extra step and generate a c header model.h file of whichever one you think is most useful.

P.S. I am impressed with the category “int8-quantized-with-float32-input-and-output” I have not seen that before, not even sure how to generate it, but I feel that could be very useful.

Code to convert TFlite files to C header files

xxd -i model.lite model.h

@Rocksetta what’s your usecase here exactly? Trying to figure out what the best way forward is.

Depending on the library type that you generate we do convert the TFLite file like this (do C++ export and disable EON, and you’ll see this) but I’d like to generate code that does everything from DSP to NN to other ML blocks rather than just focus on TFLite exports (which is just an implementation detail in the end).

1 Like

Yes, that C++ export is the key, well done and it includes the model.h file. My use case is just to find out how useful I can make Edge Impulse with Arduino boards so that my students can make any ML type sensor / Actuator program they want to.

Also just saw the webAassembly export which looks really interesting. I will also look into that, looks like a perfect fit for Gitpod which I happen to be fairly good at.

1 Like