2025-02-07 04:20 AM
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;
}
;
2025-02-07 05:37 AM
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://stedgeai-dc.st.com/assets/embedded-docs/embedded_client_api_legacy.html
Have a good day,
Julian
2025-02-07 06:23 AM
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