cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to generate the network.c from more than one models using X-CUBE-AI?

darla14
Senior

Hello,

I have a solution which I am trying to port to STM32 MCUs which are able to run a machine learning/deep learning model. 
i wanted to know is it possible to generate a combined network.c from two models? Or do I have to generate multiple network.c files like network1.c, network2.c etc.How does it work? 
I have more than one(2-3) DCNN models.

please advice

regards,

 

3 REPLIES 3
Julian E.
ST Employee

Hello @darla14,

 

You can import multiple models in X-Cube-AI and you will get network1.c network2.c etc as you said.

JulianE_0-1737017459426.png

 

I don't know what you want to achieve but you can maybe try to create a model with all your inputs, your models and outputs. For example, if you add 2 CNNs with inputs of size (28,28,3), you could create a single model with an input of size (28x28x6), then in the model split the input (with a slice layer I believe), pass each image in their models and output a vector of size (nb_class,2) which is the concatenate output of your 2 models.

 

I have never worked with multiple inputs and outputs model, so you have to try (I could not find it in the doc, but I don't think it is an issue). If using multiple inputs/outputs do not work, you can try to combine them as explained above.

 

Just make sure to respect the compatible layers and conditions:

ONNX toolbox: https://stedgeai-dc.st.com/assets/embedded-docs/supported_ops_onnx.html 

TFlite toolbox: https://stedgeai-dc.st.com/assets/embedded-docs/supported_ops_tflite.html 

Keras toolbox: https://stedgeai-dc.st.com/assets/embedded-docs/supported_ops_keras.html

 

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. ,

thanks for the prompt and detailed response. I will try that. Actually the two models (multi modality ) are coming from two different persons/teams so I have to combine them and feed the output of one to the input of other. I will check for more details.

 

Also the way you have shown is via GUI tool , but is it possible to do it via command line from stedgecore ai command line. 
i wanted to do this for both STM32 H7 as well as STM32N6.

let me know. Any example project will also help.

Regards,

D

Hello @darla14,

 

X-Cube-AI is using the ST Edge AI Core, so yes you can do it:

  • For h7: ./stedgeai --target stm32h7 --model your_model
  • For N6: ./stedgeai --target stm32n6 --model your_model (should produce the same result as for H7 in this case)
  • For N6 with Neural Art acceleration: ./stedgeai --target stm32n6 --model your_model --st-neural-art

 

With the neural art acceleration, the code that convert python layer is different as it uses acceleration hardware, so you may have issues. The list of supported layers is different:

https://stedgeai-dc.st.com/assets/embedded-docs/stneuralart_operator_support.html

 

All the documentation about stedge ai core and neural art is here:

https://stedgeai-dc.st.com/assets/embedded-docs/index.html 

 

IMPORTANT:

To use the neural art you need the stedgeai core and an addon. You can find both of them here:

STEdgeAI-Core - Artificial intelligence (AI) optimizer technology for STMicroelectronics products - STMicroelectronics

The neural art is under export control, so you need to fill a form and it will take few hours/day before you can download it.

Then when installing the stedgeai core, check the box to also install neural art and select the zip file you downloaded from the link above.

 

 

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.