Welcome to STM32 model zoo!
This project provides a collection of pre-trained models that you can easily pass through STM32Cube.AI and deploy on your STM32 board.
These models can be useful for quick deployment if you are interested in the categories that they were trained. We also provide training scripts to do transfer learning or to train your own model from scratch on your custom dataset.
This project is organized by application, for each application you will have a step by step guide that will indicate how to train and deploy the models.
- Image classification
- Object detection
- Human activity recognition (HAR)
- Audio event detection (AED)
- Hand posture recognition
- Create an account on myST and then sign in to STM32Cube.AI Developer Cloud to be able access the service.
- Or, Download latest version of STM32Cube.AI for your OS, extract the package and get the path to
stm32ai
executable. - If you don't have python already installed, you can download and install it from here, a Python Version <= 3.10 is required to be able to use TensorFlow later on, we recommand using Python v3.9 or v3.10. (For Windows systems make sure to check the Add python.exe to PATH option during the installation process).
- Clone this repository using the following command:
git clone https://github.com/STMicroelectronics/stm32ai-modelzoo.git
- Create a virtual environment for the project:
cd stm32ai-modelzoo
python -m venv st_zoo
- Activate your virtual environment, on Windows run:
st_zoo\Scripts\activate.bat
On Unix or MacOS, run:
source st_zoo/bin/activate
- Install all the necessary python packages, the requirement file contains it all.
pip install -r requirements.txt
In tutorials/notebooks you will find a jupyter notebook that can be easily deployed on Colab to exercise STM32 model zoo training scripts.
In this project, we are using TensorFLow version 2.8.3 following unresolved issues with newest versions of TensorFlow, see more.
Warning : In this project we are using the mlflow
library to log the results of different runs. Depending on which version of Windows OS are you 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. As by default, Windows uses a path length limitation (MAX_PATH) of 256 characters: Naming Files, Paths, and Namespaces. To avoid this potential error, create (or edit) a variable named LongPathsEnabled
in Registry Editor under Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\
and assign it a value of 1
. This will change the maximum length allowed for the file length on Windows machines and will avoid any errors resulting due to this. For more details have a look at this link.
A new version of STM32Cube.AI (8.1.0) will be available soon. If you are interested contact us at [email protected].