cancel
Showing results for 
Search instead for 
Did you mean: 

Questions regarding YOLOv11n raw output and use of input/output buffers

VitorWagner
Associate

Hello ST Community!

In my use of the STM32N6570-DK I have run several experiments with the kit's tools, and have arrived into some doubts regarding the overall use of the API and the models in the Model Zoo. I have the following questions:

Question 1.

The Input/Output of my YOLO model is Uint8_t/Float, confirmed by checking the value of the Buffer_DataType_TypeDef element in the network instance, which are both supposed to be stored in a single dimension array as suggested by the API.

The output of the model as per the model zoo is (1,4+K,F), with F being proportional to the input image size, in the case of a 256x256x3 image, it's value is 1344.
The value of K can be calculated by the maximum size in bytes of the output located in network.h, making the output (1,5,1344), which in a single array would mean, considering output[] as a float array buffer of the output pointer, with values normalized between [0,1]:

output[0] = Center X
output[1] = Center Y
output[2] = Width
output[3] = Height
output[4] = Score
output[5] = Center X2
output[n] = ...

I would like to know if my interpretation of such results are accurate to the model behavior, since I have not been able to get coherent results so far, be it by reinterpreting the results in the output buffer in either a float or a unsigned int.

Question 2.

During my research I have found applications that declare the input/output buffers by either getting the address to the start of the buffer:

 

const LL_Buffer_InfoTypeDef * ibuffersInfos = LL_ATON_Input_Buffers_Info(&NN_Instance_Default);
input_ptr = (uint8_t *)LL_Buffer_addr_start(&ibuffersInfos[0]);

 

Or by using LL_ATON_Set_User_Input_Buffer() with a predefined array as parameter, which is also explained by the ll_aton API doc:

uint8_t input_buff[256 * 256 * 3];
res = LL_ATON_Set_User_Input_Buffer(&NN_Instance_Default, 0, input_buff, 256 * 256 * 3);

 

So out of both approaches, what exactly is the correct way to use the input/output buffers? Should I rely on the LL_ATON_Set_User_Input_Buffer() or simply use memcpy() to write/recieve in the address of the buffer directly?


Links:
Model Zoo
https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/object_detection/yolo11n
ST Neural Art API
https://stedgeai-dc.st.com/assets/embedded-docs/stneuralart_api_and_stack.html#user-allocated-inputsoutputs

0 REPLIES 0