I am running the below github code for inference on my Raspberry Pi .I have managed to succesfully run my models on my Pi , even though one of them predicts really bad compared to the non quantized version . I have studied the code and libraries but I have difficilty understanding 2 small parts that I believe affect my model's performance .
Tensorflow's official code for running inference on tflite models . https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/python/label_image.py
The two parts are :
parser.add_argument(
'--input_mean',
default=127.5, type=float,
help='input_mean')
parser.add_argument(
'--input_std',
default=127.5, type=float,
help='input standard deviation')
I can't understand how those 2 arguments affect the Inference and why they are used in this command. How are the args values supposed to alter the input data .
if floating_model:
input_data = (np.float32(input_data) - args.input_mean) / args.input_std
Second , when is a model np.float32 type ? Aren't quantized models int type ?
floating_model = input_details[0]['dtype'] == np.float32