cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 CUBE-AI Running Multi network

bkrzn
Associate

I am producing two different models on STM32CubeIde on STM32CubeIde. I want to use two different networks by using Multi network functions in app_x-cube-ai.c file but I was not successful. Is there a document or sample code about this?

 

uint8_t init_multi_network(void)
{
if ((error = ai_mnetwork_create("onnx", &onnx_, NULL).type) == AI_ERROR_NONE)
{


if(ai_mnetwork_init(onnx_))
{
p_ai_input = ai_platform_inputs_get(onnx_,NULL); // !!!!!!!ai buffer get function is not returning valid value, returning zero
}
}
else
{

};

 

return 0;

}
;

2 REPLIES 2
Julian E.
ST Employee

Hello @bkrzn ,

 

Using multiple model is similar to using one, X cube AI will generate of the files required for each model with their set of functions.

 

I found this thread that may help you:

Can I implement multiple models through X-CUBE-AI? - STMicroelectronics Community

 

You also have the documentation of X Cube AI:

https://www.st.com/resource/en/user_manual/um2526-getting-started-with-xcubeai-expansion-package-for-artificial-intelligence-ai-stmicroelectronics.pdf 

https://stedgeai-dc.st.com/assets/embedded-docs/embedded_client_api_legacy.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.

Thanks for fast reply,

Can i get an multi-network example code with multinetwork Api functions.

const char* ai_mnetwork_find(const char *name, ai_int idx);
ai_error ai_mnetwork_create(const char *name, ai_handle* network, const ai_buffer*
network_config);
ai_bool ai_mnetwork_get_info(ai_handle network, ai_network_report* report);
ai_error ai_mnetwork_get_error(ai_handle network);
ai_handle ai_mnetwork_destroy(ai_handle network);
ai_bool ai_mnetwork_init(ai_handle network, const ai_network_params* params);
ai_i32 ai_mnetwork_run(ai_handle network, const ai_buffer* input, ai_buffer* output);

 

I couldn't find anywhere