Deploying SSCMA on Espressif Chips
A Linux or macOS computer
An ESP32-S3 development board with a camera (e.g. Seeed Studio XIAO)
A USB cable
Install the ESP-IDF
SSCMA requires ESP-IDF
4.4.x for deployment in ESP32, please refer to the following tutorial ESP-IDF Get Started Guide to install and configure the toolchain of ESP-IDF.
After completed the ESP-IDF installation, please double-check IDF Environment Config Variables is finished:
IDF_PATHenvironment variable is set.
Make sure that tools like
idf.pyand Xtensa-ESP32 (e.g.
xtensa-esp32-elf-gcc) are included in
We do not recommend that you configure ESP-IDF in a virtual environment, you can use the following command to exit a virtual environment (use the command multiple times to exit nested virtual environments).
In addition, if your ESP-IDF is not configured in a virtual environment, any operations related to ESP-IDF, such as calls to
idf.py, should be done in a non-virtual environment.
Get Examples and Submodules
Go to the root directory of the SSCMA project and run the following command to get the examples and its submodules.
git clone https://github.com/Seeed-Studio/sscma-example-esp32 -b 1.0.0 examples/esp32 && \
pushd examples/esp32 && \
git submodule init && \
git submodule update && \
You need to complete the installation and configuration of SSCMA first. If you have not installed SSCMA yet, you can refer to SSCMA Installation Guide.
Prepare the Model
Before you start compiling and deploying, you need to prepare the models that need to be deployed according to the actual application scenarios. Therefore, you may need to go through the steps of selecting a model or neural network, customizing the dataset, exporting or transforming the model, etc.
To help you understand the process in a more organized way, we have written complete documentation for different application scenarios.
Before Compile and Deploy, you need to prepare the appropriate model.
Compile and Deploy
- Go to the root directory of the SSCMA project and run the following command to access the examples directory
cd examples/esp32 # SSCMA/examples/esp32
idf.py set-target esp32s3
- Compile the example.
- Connect the ESP32 MCU to the computer and determine the serial port path. Under Linux, you can use the following command to check the currently available serial ports (the path to the serial port is typically
/dev/ttyUSB0for newly connected ESP32 devices on Linux):
lsusb -t && \
ls /dev | grep tty
- Flash the firmware (replace
<TARGET_SERIAL_PORT>with the ESP32 serial port path):
idf.py --port <TARGET_SERIAL_PORT> flash
- Monitor serial output and wait for MCU reboot (replace
<TARGET_SERIAL_PORT>with the ESP32 serial path):
idf.py --port <TARGET_SERIAL_PORT> monitor
The two commands to flash the firmware and monitor the serial port can be combined.
idf.py --port <TARGET_SERIAL_PORT> flash monitor
Ctrl+] to exit the monitor serial output screen.
The performance of SSCMA related models, measured on different chips, is summarized in the following table.
For more models go to SSCMA Model Zoo
If you find any issues in these examples, or wish to submit an enhancement request, please use GitHub Issue.
For ESP-IDF related issues please refer to ESP-IDF.
For information about TensorFlow Lite Micro, please refer to TFLite-Micro.
For SSCMA related information, please refer to SSCMA.
These examples are released under the MIT License.
These examples use ESP-IDF, which is released under the Apache 2.0 License.
The TensorFlow library code and third-party code contain their own licenses, which are described in TFLite-Micro.