cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with deploying object detection project on STM32N6-DK

cosard
Associate II

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.

19 REPLIES 19

Hello Julian,

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

 

Thank you,

Cosar.

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.

Hello @cosard ,

 

in Your_Model_Zoo_Folder/common/stm32ai_local/utils.py can you add "print(lines)" at line 306 like so:

JulianE_0-1742201261074.png

 

Can you please run the script again and send me the message complete log.

 

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.

Hello @Julian E. 

I have updated the utils.py script as you told and here is the output after I run:

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

 

[WARNING] The usable GPU memory is unlimited.
Please consider setting the 'gpu_memory_limit' attribute in the 'general' section of your configuration file.
[INFO] : Running `deployment` operation mode
[INFO] : The random seed for this simulation is 123
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
WARNING: Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#346 is a dynamic-sized tensor).
[INFO] : Generating C header file for Getting Started...
[INFO] : This TFLITE model doesnt contain a post-processing layer
loading model.. model_path="../../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite"
loading conf file.. "../../application_code/object_detection/STM32N6/stmaic_STM32N6570-DK.conf" config="None"
"n6 release" configuration is used
[INFO] : Selected board :  "STM32N6570-DK Getting Started Object Detection (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
[INFO] : Compiling the model and generating optimized C code + Lib/Inc files:  ../../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite
setting STM.AI tools.. root_dir="", req_version=""
 Cube AI Path: "/Applications/ST/STEdgeAI/2.0/Utilities/macarm/stedgeai".
[INFO] : Offline CubeAI used; Selected tools:  10.0.0 (x-cube-ai pack)
loading conf file.. "../../application_code/object_detection/STM32N6/stmaic_STM32N6570-DK.conf" config="None"
"n6 release" configuration is used
compiling... "ssd_mobilenet_v2_fpnlite_035_192_int8_tflite" session
 model_path  : ['../../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite']
 tools       : 10.0.0 (x-cube-ai pack)
 target      : "STM32N6570-DK Getting Started Object Detection (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
 options     : --st-neural-art default@../../application_code/object_detection/STM32N6/Model/user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast
"series" value is not coherent.. stm32n6 != stm32n6npu
 results -> RAM=621,048 IO=110,592:153,800 WEIGHTS=1,618,465 MACC=0 RT_RAM=1,773 RT_FLASH=607,353 LATENCY=0.000
[INFO] : Optimized C code + Lib/Inc files generation done.
[INFO] : Building the STM32 c-project..
deploying the c-project.. "STM32N6570-DK Getting Started Object Detection (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
updating.. n6 release
 -> s:copying file.. "network.c" to ../../application_code/object_detection/STM32N6/Model/network.c
 -> s:copying file.. "network_ecblobs.h" to ../../application_code/object_detection/STM32N6/Model/network_ecblobs.h
 -> s:copying file.. "network_atonbuf.xSPI2.raw" to ../../application_code/object_detection/STM32N6/Model/network_atonbuf.xSPI2.raw
 -> s:removing dir.. ../../application_code/object_detection/STM32N6/Middlewares/AI_Runtime/Lib/GCC/ARMCortexM55
 -> s:copying dir.. "ARMCortexM55" to ../../application_code/object_detection/STM32N6/Middlewares/AI_Runtime/Lib/GCC/ARMCortexM55
 -> s:removing dir.. ../../application_code/object_detection/STM32N6/Middlewares/AI_Runtime/Inc
 -> s:copying dir.. "Inc" to ../../application_code/object_detection/STM32N6/Middlewares/AI_Runtime/Inc
 -> s:removing dir.. ../../application_code/object_detection/STM32N6/Middlewares/AI_Runtime/Npu/ll_aton
 -> s:copying dir.. "ll_aton" to ../../application_code/object_detection/STM32N6/Middlewares/AI_Runtime/Npu/ll_aton
 -> u:copying file.. "app_config.h" to ../../application_code/object_detection/STM32N6/Inc/app_config.h
 -> updating cproject file "/Users/cosardindar/Projects/techsols/STM32N6/stm32ai-modelzoo-services/application_code/object_detection/STM32N6/STM32CubeIDE" with "NetworkRuntime1000_CM55_GCC.a"
building.. n6 release
flashing.. n6 release STM32N6570-DK
[returned code = 127 - FAILED]
['$ cwd:  ../../application_code/object_detection/STM32N6/STM32CubeIDE', '$ args: NOT FOUND -c port=swd mode=HOTPLUG -hardRst -w Debug/STM32N6_GettingStarted_ObjectDetection_signed.bin 0x70100000', '/bin/sh: NOT: command not found']
[INFO] deployment complete
[INFO] : Please on STM32N6570-DK toggle the boot switches to the left and power cycle the board.

 

 

Julian E.
ST Employee

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.

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.

cosard
Associate II

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.

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.
cosard
Associate II

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.

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.