Tflmicro with esp32-cam

Hi to all, I’m new to tflmicro and want to know how to use it th esp32-cam. I already train a model for object recognition using Keras and the size model with optimization is about 4MB. Converting the model to cc file I got 22MiB which is huge for this board (only has 4MB PSRAM). Maybe I’m missing other optimizations, but by looking into the examples i see object detection been size in order of KiB.
The only example I was able to use was the sine_model. Any help? A link to source for reading will be appreciated (I read the README in the examples )
Gastón

Hi @Gaston_Melo

To use TFLM on ESP32-CAM for object recognition these are the steps you can follow .

  1. Prepare the model using Keras and convert it to TFLite.
  2. Optimize the model for size using quantization, pruning, and weight sharing.
  3. Integrate TFLM into your ESP32-CAM project.
  4. Create a TFLite interpreter and allocate tensors.
  5. Prepare input data and run inference. Process output data.

If the model is too large, consider further optimization techniques and hardware acceleration.Additionally you can follow this documentations for more better functionality and understanding

Thank You .