Model Selection and Loading
This document explains how to select and load models for ESP-SR.
Model Selection
ESP-SR allows you to choose required models through the menuconfig interface. To configure models:
Run
idf.py menuconfigNavigate to ESP Speech Recognition
Configure the following options: - Noise Suppression Model - VAD Model - WakeNet Model - MultiNet Model
Updating Partition Table
You must add a partition.csv file and ensure that there is enough space for the selected models.
Add the following line to your project’s partitions.csv file to allocate space for models:
model, data, , , 6000K
Replace
6000Kwith your custom partition size according to the selected models.modelis the partition label (fixed value).
Model Loading
ESP-IDF Framework
ESP-SR automatically handles model loading through its CMake scripts:
Flash the device with all components:
idf.py flashThis command automatically loads the selected models.For code debugging (without re-flashing models):
idf.py app-flash
Note
The model loading script is defined in esp-sr/CMakeLists.txt. Models are flashed to the partition labeled model during initial flashing.
Arduino Framework
To manually generate and load models:
Use the provided Python script to generate
srmodels.bin:python {esp-sr_path}/movemodel.py -d1 {sdkconfig_path} -d2 {esp-sr_path} -d3 {build_path}
Parameters:
esp-sr_path: Path to your ESP-SR component directorysdkconfig_path: Project’ssdkconfigfile pathbuild_path: Project’s build directory (typicallyyour_project_path/build)
The generated
srmodels.binwill be located at:{build_path}/srmodels/srmodels.binFlash the generated binary to your device.
Important
Just regenerate srmodels.bin after changing model configurations in menuconfig.