Skip to main content
Associate III
August 25, 2025
Question

Stm32n657-dk board with Zoo models

  • August 25, 2025
  • 4 replies
  • 2594 views

Dear Team

How can I implement Zoo models on the STM32N657-DK board?

 

4 replies

Julian E.
Technical Moderator
August 25, 2025

Hello @Kumar123,

 

You have the ST Model Zoo: GitHub - STMicroelectronics/stm32ai-modelzoo: AI Model Zoo for STM32 devices

That contains model that you can use with the ST Model Zoo Services or with the Standalone getting started

 

ST Model Zoo Services: GitHub - STMicroelectronics/stm32ai-modelzoo-services: AI Model Zoo services for STM32 devices

Standalone getting started: STM32N6-AI | Software - STMicroelectronics

 

With the ST Model Zoo Services, you can find documentation to retrain a model, quantize a model, evaluate a model, deploy a model etc. You need to edit the user_config.yaml and run the stm32_main.py script.

 

With the Standalone getting started, you can replace the default model with models from the model zoo. See the doc in /Doc (you will mainly need to convert the model to c and edit the postprocessing).

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Kumar123Author
Associate III
August 25, 2025

Dear Julian

Thank you for your response. I’ve installed the packages, but I’m not familiar with the Model Zoo. I’ve chosen the image_classification example—how do I implement it? Please guide me step by step

GitHub - STMicroelectronics/stm32ai-modelzoo: AI Model Zoo for STM32 devices

GitHub - STMicroelectronics/stm32ai-modelzoo-services: AI Model Zoo services for STM32

 STM32N6-AI | Software - STMicroelectronics

 

Julian E.
Technical Moderator
August 25, 2025

Hello @Kumar123,

 

For image classification, everything is explained in the different readme:

stm32ai-modelzoo-services/image_classification at main · STMicroelectronics/stm32ai-modelzoo-services · GitHub

 

You will find a link for each operation modes (training, quantization, deployement ect) with step by step guide.

 

Keep in mind that the way it works is similar. It is always:

  1. Edit the user_config.yaml
  2. Run stm32ai_main.py

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
September 8, 2025

Hi. I guess you need to download and unzip to "./datasets/flower_photos" flower_photos dataset to train your model.
https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz

 

Kumar123Author
Associate III
September 8, 2025

Hi Avburnel

I downloaded the flower_photos zip file and ran stm32ai_main.py for image classification. It started training for up to 1000 epochs. I have attached the output here for your reference. Could you please guide me on the next steps?
https://wiki.st.com/stm32mcu/wiki/AI:How_to_use_Teachable_Machine_to_create_an_image_classification_application_on_STM32

The above link’s steps up to Step 2 have been completed. How do I port the model to the STM32N657 board? I have downloaded the ZIP file, which contains the generated label and model.tflite files (attached). Could you please guide me?

 

 

 

September 8, 2025

Number of epochs is configurable in user_config.yaml.

The idea is to obtain the C source code from the tflite model and then deploy it into a ready-made example. After running the script, the necessary files should appear in the image_classification\src\experiments_outputs directory.

 

All that remains is to deploy them. This can be done using the same user_config file. You need to check the deployment section. In my case, it looks like this, but yours will differ because you are using a different board:

 
 
deployment:
c_project_path: ../application_code/image_classification/STM32H7
IDE: GCC
verbosity: 1
hardware_setup:
serie: STM32H7
board: STM32H747I-DISCO
 

Also, ensure everything is correct in the tools and model_path sections, connect the board via ST-LINK, specify deployment in the operation_mode section, and run the script. The source files should be copied into the project for Cube IDE, compiled, and automatically flashed onto the board. Afterward, you can open the project, use the debugger, and make modifications or upgrades as needed.

September 8, 2025

So If you have your own model, you don't need to execute chain_tqeb.
You just use script to get the C sources. Even the script is not really necessary. Here is the link to the online service to get C sources from your model.
https://stedgeai-dc.st.com/home

Kumar123Author
Associate III
September 9, 2025

Hi Avburmel

I am developing my own model for image classification. I followed the link below and generated the C source files. Could you please tell me what the next step is?

https://stedgeai-dc.st.com/home

I have attached here generating C source files

September 9, 2025

You should deploy C source files to a default project which is a part of model-zoo, build it and flash your board.

 

Unfortunately I don't remember all the correct paths for this files.

For start If you trained your own default model as your previous output says, you can deploy sources with the same script and user_config.yaml. Change model_path to: 
"YOUR_PATH\image_classification\src\experiments_outputs\YOUR_TRAINING_DATETIME\quantized_models\quantized_model.tflite"
Change operation_mode from chain_tqeb to deployment.
Check "tools" and "deployment" sections are correct, save user_config file and run the script.

If script will work files will deploy to the project and you can open it and see all the paths you need.

Screenshot is from the step "3.6 Deployment"

deploy.PNG

Also you can try to download not just sources from the site. There is an option to get the cube project with your sources. You can download the project, see all the paths you need, than find the same paths in a default model-zoo project and copy your files.

September 8, 2025

Your output looks like you did "chain_tqeb". This operation_mode executes when you need to get the model from dataset. After that action you should get .tflite file created from dataset with your script parameters with path like this: "\image_classification\src\experiments_outputs\2025_08_19_12_37_31\quantized_models\quantized_model.tflite"

If you have a path to your model, set it to "model_path:" and try "operation_mode: deployment"