KSNN Conversion - What is the mean value?

Which Khadas SBC do you use?

VIM3 Pro

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu 20.04

Which version of system do you use? Khadas official images, self built images, or others?

Official

I want to convert YOLOX model using conversion tool (Instructions for KSNN conversion tool | Khadas Documentation ). What is the “–mean values” variable used when calling the “./convert” command? How can I find out the “–mean values” value of the model I will convert?

@Huseyin_Cayirli This is the normalization parameter, this participation is used to limit all your data to [-1, 1] or [0, 1]

@Frank So do I need to make the first 3 values 255 to normalize the input image in the range [0 , 1]? If so, what is the 4th parameter (index with the value of 0.0078125 in the image)?

@Huseyin_Cayirli Please check the doc in SDK. (value - 128)*0.0078125=[0, 1]

Do I need to normalize each input image manually during inference time (i.e. when I am running it on board)??

@jchecker You need to make sure that the input image data is the same size as the model itself.

My image is on the same size but it fails to predict correctly and gives really bad results. When I run the tflite model on my local machine it predicts correctly for the same image. Do I need to do some pre-processing of data before sending it to ksnn_inference ?

@jchecker You can refer to my demo. Data requires a lot of processing. Unlike the logic on the PC.

Which demo? Because I have been referring to the Khadas VIM3 documentation. My problem is classification problem and in that documentation no special pre-processing of data is to be done is mentioned. Is it possible for you to guide me to the link of demo you are talking about?

@jchecker As yolov3 as e axample

You can follow this page.

You can check other demos in same repo

Here as I read it I notice there is a lot of post-processing done but no pre-processing done. I am having issues predicting a stream of video incorrectly because my input stream does not match the one I gave for training. Moreover, I cannot use TensorFlow libraries to change my input to the desired form. Any documentation on how should I do pre-processing of data in order to change the input format just before inference time on board?

@jchecker I can’t provide much help in this part. My method is to use the OpenCV interface, adjust it to the size of the model, and then input it to the model for use.