mocleiri / tensorflow-micropython-examples

A custom micropython firmware integrating tensorflow lite for microcontrollers and ulab to implement the tensorflow micro examples.
MIT License
170 stars 79 forks source link

Change esp32 to build on top of the tflite-micro-esp-examples idf component #127

Open mocleiri opened 10 months ago

mocleiri commented 10 months ago

This is work in progress to change how tensorflow is built and linked into the microlite firmware. Instead of enumerating all of the source files I build the tensorflow part with esp_nn for accelerated ops directly as an esp-idf component.

It also upgrades the microlite module to work with latest micropython master (>1.20.0).

The submodules are deleted. Instead a new scripts/build.sh has been created. It has two functions:

  1. prepare_dependencies - this will create a dependencies subdirectory and setup a shallow clone of: ulab, micropython, tflite-micro-esp-examples, esp32-camera, micropython-camera-driver, tflite-micro
  2. build_esp32 - this will build the esp32 boards. At the moment it works for the boards/esp32/build/MICROLITE board.

I've run through the steps manually and was able to build firmware for the MICROLITE board and flash it an run the microspeech demo.

The second commit contains changes from @uraich for upgrading microlite to use the new module registration macros.

The next steps are to change the ci builds to use the new build script, upgrade the other board configurations and ensure the unix and rp2 builds still work properly.