cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 + YOLOv8n ONNX Model. Issues with PNG Input and Code Generation

TerZer
Associate III

Hi everyone,

I'm working with an STM32N6 board and trying to deploy a custom YOLOv8n model in ONNX format using CubeMX and STM32 Edge AI. I’ve run into a few issues and was hoping someone could help clarify the process.

Here’s what I’ve done so far:

I successfully imported my yolov8n.onnx model into CubeMX + Edge AI.

When I try to test the model using a .PNG image, I get an error saying PNG format is not supported. When I generate the C code using the model, I see a line in network.c where -inf is not defined, causing compilation errors.

My Questions:

How can I test my model using a PNG image, either on the STM32N6 device or on a desktop simulation?

Do I need to convert the PNG to raw input data manually?

What’s the correct way to prepare a PNG image as an input buffer for use with STM32 inference code?

How do I resolve the -inf not defined issue in the generated network.c?

Any help, code snippets, or documentation pointers would be greatly appreciated!

Thanks in advance!

13 REPLIES 13

@TerZer,

It should be ok next week.

 

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 @TerZer,

 

You can find the tutorial here:

How to build an AI application from scratch on the... - STMicroelectronics Community

 

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.
TerZer
Associate III

Hello @Julian E. ,

First off, thanks for your tutorial — it was really helpful! However, I ran into an issue. I tried to create a TouchGFX application, and when I attempted to add the X-CUBE-AI component in STM32CubeMX, I got the following message:

This component cannot be selected:

- This application cannot be selected while the application Application from pack STMicroelectronics.X-CUBE-TOUCHGFX.4.25.0 is selected.

Is there a known workaround or specific setup needed to use both X-CUBE-AI and TouchGFX in the same project?

P.S.
All software is on latest version:
X-CUBE-AI version 10.2.0

X-CUBE-TOUCHGFX 4.25.0

Hello @TerZer,

You are right, I am asking the dev of X Cube AI the reason for that. 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.