cancel
Showing results for 
Search instead for 
Did you mean: 

Problems about stm32ai-modelzoo and x-cube-ai with CubeMX

123456dad
Associate II

123456dad_0-1700136656954.png

I am curious about these parameters,I don`t konw where they are used.

123456dad_1-1700136788170.png

These are auto generated by following the official guide, but if I want to build a project with x-cube-ai and CubeMX my own and still use the model from model zoo, how shoul i deal with these two parameters.

I dont`t see anything about this in code that auto generated by CubeMX with x-cube-ai.

I just know the input of model is int8 as follow,but i see these two parameters in stm32ai-modelzoo official guide

I am learning quantization, but still not familiar with it, shoul i do smething in my own project generated by CubeMX?

I just give my model input image data [0:255] now and it works,but after reading the modelzoo guide I don`t know if it`s right.Thank you!!!!!

123456dad_2-1700137290334.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
GRATT.2
ST Employee

Hello @123456dad,

 

These two values nn_input_norm_scale and nn_input_norm_zp were created to implement later the support for floating point values as input for the NN. They would allow the user to apply a scale/offset preprocessing. Afterwards we found the float format is not suitable for edge AI image processing, so we kept only the uint8 and int8 input format.

The reason why your code is working is because the quantized models included in the ModelZoo expect an uint8 input format. The camera image data is converted by the DMA2D into uint8 values so there no need to change their format in the preprocessing before it is used as input by the NN.

 

Guillaume R.

View solution in original post

1 REPLY 1
GRATT.2
ST Employee

Hello @123456dad,

 

These two values nn_input_norm_scale and nn_input_norm_zp were created to implement later the support for floating point values as input for the NN. They would allow the user to apply a scale/offset preprocessing. Afterwards we found the float format is not suitable for edge AI image processing, so we kept only the uint8 and int8 input format.

The reason why your code is working is because the quantized models included in the ModelZoo expect an uint8 input format. The camera image data is converted by the DMA2D into uint8 values so there no need to change their format in the preprocessing before it is used as input by the NN.

 

Guillaume R.