2025-08-25 12:12 AM
2025-09-08 2:32 AM
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?
2025-09-08 2:49 AM
To use Zoo models on the STM32N657-DK board, you will need to convert the model to a format that the board can understand, such as with STM32Cube.AI. Make sure the model is small and works well on such devices. Let me know which model you are using!
2025-09-08 2:57 AM - edited 2025-09-08 3:13 AM
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:
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.
2025-09-08 3:18 AM
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
2025-09-08 4:18 AM
Hi Avburmel
The board is connected and I ran the script. I have attached the output here for your reference. I also changed the deployment mode, and in the src folder the experiments_output files were generated. However, when I disconnect the board and check it, I don’t see any results.
2025-09-08 4:28 AM - edited 2025-09-08 4:52 AM
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"
2025-09-09 2:32 AM
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
2025-09-09 3:11 AM - edited 2025-09-09 3:19 AM
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"
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.
2025-09-10 4:21 AM
Hi Avburmel
Thank you for your support. My own model is also working fine. How can I develop my own application using STM32CubeIDE? Could you please guide me?
2025-09-10 4:37 AM - edited 2025-09-10 4:40 AM
Hi.
After successful deployment the project path is:
"stm32ai-modelzoo-services\application_code\image_classification\YOUR_PLATFORM\Application\YOUR_BOARD\STM32CubeIDE"
You can open this project in STM32CubeIDE and modify code as you want. You can change model, add logic etc.