Skip to main content
Associate
March 13, 2025
Solved

Issue with deploying object detection project on STM32N6-DK

  • March 13, 2025
  • 6 replies
  • 2830 views

Hello,

I am trying to test a deployed application for object detection.

I have tested out of the box object detection application code.

I can successfully build the project and I can run the code on my board.

Unfortunately it doesn't detect any objects. It is supposed to detect person but it never detected.

I have tried to use different pre-trained models and built and run them successfully but none of them work.

The screen shows the live camera image, shows inference value and detected object number is always zero.

Is there anything that I miss?

 

By the way, the factory demo AI application works perfectly, it successfully detects people. So the hardware is OK.

Best answer by carlbidwell

Hi! I know how frustrating it can be when the demo works but your own models don’t seem to detect anything. A few things you could try:

  • Lower the confidence/NMS thresholds just to see if any boxes show up.
  • Double-check your USB‑C cable, a bad connection can sometimes cause issues.
  • Try using a local .tflite model instead of loading it from a URL.
  • Sharing the full terminal output from stm32ai_main.py could help figure out what’s going wrong.

Also, there’s a similar thread where someone had a deployment issue on the STM32N6 that might give some hints: https://community.st.com/t5/stm32-mcus-boards-and-hardware/deployment-error-with-object-detection-stm32n6-model-deployment/td-p/800874

6 replies

Julian E.
Technical Moderator
March 13, 2025

Hello @cosard ,

 

Could you describe more what you do please:

  • Are you using the getting started as a standalone or with model zoo
  • Which tutorial are you following
  • Which model are you trying to deploy

 

If you are using the standalone getting started, when doing the stedgeai generate, please try adding a few options:

stedgeai generate --model your_model.tflite --target stm32n6 --st-neural-art default@user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast

 

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.
cosardAuthor
Associate
March 13, 2025

Hi Julian,

Thank you for your response.

 

I first downloaded the application code from ST website.

I downloaded both n6-ai-getstarted and n6-ai-pdetect projects.

I built both as separate projects in CubeIDE and run them on STM32N6570-DK board.

I was not able to detect any Person objects.

 

Also I have followed the tutorial in

https://github.com/STMicroelectronics/stm32ai-modelzoo-services/blob/main/object_detection/deployment/README_STM32N6.md#2

After following all the steps there the stm32ai.py command updates the project that we provided as application code inside the modelzoo-services folder. 

I have flashed the code through the generated CubeIDE project.

 

I tried different trained models such as 

ssd_mobilenet_v2_fpnlite_035_192_int8.tflite

st_yolo_x_nano_192_0.33_0.25_int8.tflite

st_ssd_mobilenet_v1_025_192/st_ssd_mobilenet_v1_025_192_int8.tflite

tiny_yolo_v2_224_int8.tflite

tiny_yolo_v2_416_int8.tflite

 

and generated the project with the command below.

python stm32ai_main.py --config-path ./config_file_examples/ --config-name deployment_xx.yaml

 

Could you how can I provide a json file with the command you have provided

 

stedgeai generate --model your_model.tflite --target stm32n6 --st-neural-art default@user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast

 

Thanks.

Julian E.
Technical Moderator
March 13, 2025

Hello @cosard ,

 

Thank you for the information.

The command I send you is to use instead as replacement when you follow the Deploy-your-tflite-Model.md in the getting_started/STM32N6/object_detection/Doc

 

But I think it is easier to do it with model zoo.

Can you send me the output of your terminal when running the stm32ai_main.py please.

 

When switching the boot pin from left to right or the other way around, make sure to unplug the N6 and plug it again

 

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.
Julian E.
Technical Moderator
March 14, 2025

Hello @cosard ,

 

Can you try to reduce the thresholds to something low like 0.01:

postprocessing:
 confidence_thresh: 0.01
 NMS_thresh: 0.01
 IoU_eval_thresh: 0.01
 max_detection_boxes: 10

The goal is to see it you can manage to display green bounding boxes, even if totally wrong.

 

I'll keep you updated.

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.
cosardAuthor
Associate
March 14, 2025

Hello Julian,

I have updated the threshold values as you provided but I still can't get any green boxes.

 

Thank you,

Cosar.

Julian E.
Technical Moderator
March 14, 2025

Hello @cosard ,

 

Thank you for all your tests. 

I am in contact with the dev team. 

I'll update you as soon as I can.

 

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.
Julian E.
Technical Moderator
March 18, 2025

Hello @cosard ,

 

Thank you.

We think that it is a bug on our side on MacOS.

I'll keep you updated.

 

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.
cosardAuthor
Associate
March 18, 2025

Hello Julian,

 

Thank you for informing. Hope it could be fixed.

By the way, I am having the same object detection issue with the sample projects provided here.

 

https://www.st.com/en/development-tools/stm32n6-ai.html

 

Thanks,

Cosar.

cosardAuthor
Associate
March 24, 2025

Hello @Julian E. 

Could you be able to reproduce the issue on your side with a STM32N6570-DK board?

Also do you think the issue I am having is related with MacOS scripts?

 

Thank you.

Julian E.
Technical Moderator
March 24, 2025

Hello @cosard ,

 

I have contacted the development team and yes, thanks to the logs that you sent me, they think it is most likely due to MacOs. I am asking for an update as I don't have a Mac to test it on my side. I will update you if I get news.

 

In the meantime, if you have access to a non MacOs device and if you want to use it, you should be able to make model zoo work.

 

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.
cosardAuthor
Associate
March 28, 2025

Hi @Julian E. ,

 

I am trying to arrange a Windows machine and start development on it.

Apart from the projects generated by model zoo scripts I have also tested getting started projects provided within the link below.

https://www.st.com/en/development-tools/stm32n6-ai.html

 

I have built the projects and flashed into the DK board but still getting the same result with no detected objects on the LCD screen.

Is there a way that you can guide me to narrow down and hopefully fix the issue?

 

Thank you.

Julian E.
Technical Moderator
April 8, 2025

Hello @cosard ,

 

Sorry, I did not see your answer.

 

For the last part of your message, did you flashed it following the doc or did you used model zoo.

If you used the standalone, you must have done the following commands, please add "--input-data-type uint8 --inputs-ch-position chlast":

stedgeai generate --model yolov8n_integer_quant.tflite --target stm32n6 --st-neural-art default@user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast
cp st_ai_output/network.c .
cp st_ai_output/network_ecblobs.h .
cp st_ai_output/network_atonbuf.xSPI2.raw network_data.xSPI2.bin
arm-none-eabi-objcopy -I binary network_data.xSPI2.bin --change-addresses 0x70380000 -O ihex network_data.hex

 

In model zoo, I used a yolov8 quantized with the yaml attached.

 

Make sure to use a USB C to USB C cable, it is very important.

 

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.
carlbidwellBest answer
Visitor II
November 17, 2025

Hi! I know how frustrating it can be when the demo works but your own models don’t seem to detect anything. A few things you could try:

  • Lower the confidence/NMS thresholds just to see if any boxes show up.
  • Double-check your USB‑C cable, a bad connection can sometimes cause issues.
  • Try using a local .tflite model instead of loading it from a URL.
  • Sharing the full terminal output from stm32ai_main.py could help figure out what’s going wrong.

Also, there’s a similar thread where someone had a deployment issue on the STM32N6 that might give some hints: https://community.st.com/t5/stm32-mcus-boards-and-hardware/deployment-error-with-object-detection-stm32n6-model-deployment/td-p/800874