This project is about running ML models on a microcontroller, in this case, the ESP32. The ML model is a simple sin predictor. The programme generates random numbers, predicts the sin using the ML model, and prints it to the serial monitor.
- C++
- Python
- Tensorflow
- Keras
- TensorFlow Lite
First, train the model.For this, you need anaconda and python installed. Then run the Jupyter notebook "Train Model.ipynb". After training the model, you need to convert it to TFlite format so it can run on a microcontroller. Since the ESP32 doesn't have a filesystem by default, the tflite file needs to be converted to a char array. You can achieve this by running this command.
xxd -i converted_model.tflite > model_data.cc
Generating The model is now complete.
Next, build and upload the code to the microcontroller. For this, I used the VS code extension PlatformIO
