cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6570-DK loading self-trained model to example GettingStarted program

anardella
Associate

I have been working with and familiarized myself with the GettingStarted applications, most specifically the object detection program found on GitHub: https://github.com/STMicroelectronics/STM32N6-GettingStarted-ObjectDetection

I would like to take the next step and load my own model onto the board, I like the setup the current code has to output the frames and show the inference processing on the LCD screen and would prefer to utilize the current sample code if possible. 

 

My question is this

Am I able to load in my own model I trained using the ModelZoo services, replacing the current model after I convert it to C code. Or will I have to make my own code from scratch to do this Camera->Frame->NN->LCD pipeline

And

Do I have to train the model using a certain resolution? I am currently gathering training images by running code found here: https://github.com/STMicroelectronics/x-cube-n6-camera-capture
The output frame that is captured is 800x480 resolution RGB888, I am then going to annotate and train using those images gathered. I ask this because in the app_config.h the NN_WIDTH and NN_HEIGHT are both set to 480, making me believe it is currently taking in images at 480x480. If so would it be easier to resize/crop images to 480x480 or set the config differently?

 

All-in-all I'm just wanting to see if there is an easy way to load a custom model and test it on this board. Preferably with code that is already available.

 

Thanks for your help!

1 REPLY 1
Julian E.
ST Employee

Hello @anardella,

 

In the /Doc folder, you will find a document on how to deploy your own TFlite.

STM32N6-GettingStarted-ObjectDetection/Doc/Deploy-your-tflite-Model-STM32N6570-DK.md at main · STMicroelectronics/STM32N6-GettingStarted-ObjectDetection · GitHub

 

It mainly consists of doing a generate command with the st edge ai core, sign the binary and change the post processing.

 

I would suggest you look at the model supported (hosted on model zoo and listed in the postprocessing: STM32N6-GettingStarted-ObjectDetection/Middlewares/lib_vision_models_pp/lib_vision_models_pp/README.md at main · STMicroelectronics/STM32N6-GettingStarted-ObjectDetection · GitHub)

 

Then try with your own model and create the corresponding post processing.

 

You can also look at the model zoo services for object detection: stm32ai-modelzoo-services/object_detection at main · STMicroelectronics/stm32ai-modelzoo-services · GitHub

You can easily retrain model we provide on model zoo (not services) and deploy it easily with script on the dk board (it modifies the getting started application)

 

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.