2024-09-29 06:14 PM
I am trying to integrate the a neural network machine learning model into the stm32h755 chip. I downloaded the stmCubeMx, installed X-Cube-Ai, selected the core, added the network using tflite file and then generated the code. I can't find the ai_model_data.c, ai_model_data.h, ai_model.h and some other important files. Could you please provide a detailed steps by step process to integrate the Neural Network in an ALREADY created/ EXISTING project?
Solved! Go to Solution.
2024-10-01 03:00 AM
Hello @slodh ,
If you have an already existing CubeMX project. Open your .ioc file with cubeMX and add X-Cube-AI as you would for a new project:
Then:
Then you generate the Code.
Because you activated X-Cube-AI, you can access the documentation by clicking help>X-Cube-AI Documentation:
In there, in the Embedded Inference Client API, you will find a getting started - Minimal application code.
I think that you can start by adding that to your main.c and see how it goes first.
Another thing you can do is use ST Edge AI Developer Cloud to generate a working application in a few click and look at it to see how it is made. To do so:
The code generate simply integrate the model given and do an inference with a random input (of the size of the input in the model) and output through serial, some information like the inference time.
I hope it helps.
Julian
2024-10-01 03:00 AM
Hello @slodh ,
If you have an already existing CubeMX project. Open your .ioc file with cubeMX and add X-Cube-AI as you would for a new project:
Then:
Then you generate the Code.
Because you activated X-Cube-AI, you can access the documentation by clicking help>X-Cube-AI Documentation:
In there, in the Embedded Inference Client API, you will find a getting started - Minimal application code.
I think that you can start by adding that to your main.c and see how it goes first.
Another thing you can do is use ST Edge AI Developer Cloud to generate a working application in a few click and look at it to see how it is made. To do so:
The code generate simply integrate the model given and do an inference with a random input (of the size of the input in the model) and output through serial, some information like the inference time.
I hope it helps.
Julian
2024-10-02 10:31 PM
Thanks a lot Julian, I followed the steps and generated the C++ code from the developer cloud. But I am not able to integrate (#include ) it. I have attached the photos for reference. Could you please help me fix this?
2024-10-02 10:33 PM
Consider this photo too
2024-10-03 12:31 AM
Hello @slodh ,
As you think, it seems to be an error in the paths.
You other paths start with "../..", maybe try to put something like "../../sensor_model/"
Have a good day,
Julian
2024-10-05 11:27 PM
Hey Julian,
Thank you for your support. I am having a lot of issues. Could you please get on a zoom call to resolve it ?
I am situated in Brisbane, Australia (AEST). Please let me know a suitable time according to your convenience at the earliest. Anytime tomorrow on Monday 7th October would do.
Cheers
2024-10-07 01:24 AM - edited 2024-10-07 01:25 AM
Hello,
It would be easier for me to do it through ST Community to keep a trace for other that may have the same issues that you have. Also, I am based in Europe, so finding a time slot is not easy and I will probably need to contact experts depending on your questions to have the answers.
If you could describe where you are at, it would be great.
In the meantime, you can check this resource. The use case is different, but the CubeAI integration part may help you:
AI:How to perform motion sensing on STM32L4 IoTnode - stm32mcu
Julian.
2024-10-09 08:33 PM
I tried integrating it with my the current code that I have. I am getting this error
2024-10-10 12:46 AM - edited 2024-10-10 12:48 AM
Hello @slodh ,
These kinds of errors are outside of my knowledge and scope of the EdgeAI threads. Please open a new thread in the ST Community in the right section like here for example: STM32CubeIDE (MCUs) - STMicroelectronics Community
Have a good day.
Julian
2024-10-26 03:24 AM
I appreciate the resources you've shared. I'll check the paths again and see if that resolves the integration issues. If I still have problems, I might start a new thread as you suggested.