Getting Started ¶
Before You Start ¶
For a detailed guide on installing and setting up the model zoo and its requirements, especially when operating behind a proxy in a corporate environment, refer to the wiki article How to install STM32 model zoo.
Create an account on myST and sign in to ST Edge AI Model Bench to access the service.
Alternatively, install STEdgeAI Core locally and obtain the path to the
stm32aiexecutable.If using a GPU, install the appropriate GPU driver. For NVIDIA GPUs, refer to the CUDA and cuDNN installation guide. On Windows, for optimal GPU training performance, avoid using WSL. If using conda, see below for installation.
For Docker-based execution of the Model Zoo, see docker/README.md.
Python 3.13 is required. Download it from python.org.
On Windows, ensure the Add python.exe to PATH option is selected during installation.
On Windows, if you plan to use the
pesqlibrary (for speech quality evaluation), you must have Visual Studio with C++ build tools installed. Download from Visual Studio Downloads.
Clone this repository:
git clone https://github.com/STMicroelectronics/stm32ai-modelzoo-services.git --depth 1
cd stm32ai-modelzoo-services
Create a Python environment using either venv or conda:
With venv:
python -m venv st_zoo
With conda:
conda create -n st_zoo python=3.13
Activate your environment:
venv (Windows):
st_zoo\Scripts\activate.bat
venv (Unix/Mac):
source st_zoo/bin/activate
conda:
conda activate st_zoo
If using an NVIDIA GPU with conda, install CUDA libraries and set the path:
conda install -c conda-forge cudatoolkit=11.8 cudnn
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
Then install all required Python packages:
pip install -r requirements.txt
Initialize Git Submodules ¶
Some application code in this repository is provided as git submodules. These submodules contain essential code for specific use cases and are not included in the main repository by default. To ensure all features and application examples work correctly, you need to initialize and update the submodules after cloning the repository:
git submodule update --init --recursive
This command will download all necessary submodules content, it is only needed if you plan to use deployment features.
YAML Generator ¶
From the repository root, run:
python run-ui.py
The launcher checks that the backend and prebuilt frontend assets are available, then starts the production server. Open http://127.0.0.1:8050/st-edge-ai-model-configurator/ in your browser, or use the URL printed in the terminal.
Practical Notes ¶
Caution
If there are any white spaces in the paths (for Python, STM32CubeIDE, or STEdgeAI Core local installation), this can result in errors. Avoid having paths with white spaces.
Tip
In this project, we are using the ClearML library to log the results of different runs.
ClearML Setup ¶
Sign Up: Sign up for free to the ClearML Hosted Service. Alternatively, you can set up your own server as described here.
Create Credentials: Go to your ClearML workspace and create new credentials.
Configure ClearML: Create a
clearml.conffile and paste the credentials into it. If you are behind a proxy or using SSL portals, addverify_certificate = Falseto the configuration to make it work. Here is an example of what yourclearml.conffile might look like:
api {
web_server: https://app.clear.ml
api_server: https://api.clear.ml
files_server: https://files.clear.ml
# Add this line if you are behind a proxy or using SSL portals
verify_certificate = False
credentials {
"access_key" = "YOUR_ACCESS_KEY"
"secret_key" = "YOUR_SECRET_KEY"
}
}
Once configured, your experiments will be logged directly and shown in the project section under the name of your project.
MLflow Setup ¶
In this project, we are also using the MLflow library to log the results of different runs.
Windows Path Length Limitation ¶
Depending on which version of Windows OS you are using or where you place the project, the output log files might have a very long path, which might result in an error at the time of logging the results. By default, Windows uses a path length limitation (MAX_PATH) of 256 characters. To avoid this potential error, follow these steps:
Enable Long Paths: Create (or edit) a variable named
LongPathsEnabledin the Registry Editor underComputer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystemand assign it a value of1. This will change the maximum length allowed for the file path on Windows machines and will avoid any errors resulting due to this. For more details, refer to Naming Files, Paths, and Namespaces.GIT Configuration: If you are using Git, the line below may help solve the long path issue:
git config --system core.longpaths true