Image normalization
Updated:Aug 4, 2021
Question
How to normalize images when converting AI models.
Answer
Can be set with IN_MEAN and IN_SCALE in setting.conf file.
Â
IN_MEAN : Parameters for subtractive normalization
Values that have an average of 0 (For 0-255, it is 127.5)
If the values are different in RGB, enter them separated by commas without spaces. (103.94,116.78,123.68)
IN_SCALE : Parameters for division normalization
Value that gives a variance of 1 (For 0-255, it is 255)
If normalization is performed with the above parameters specified, processing is performed in the following order. (Standardization)
subtraction (IN_MEAN) ⇒ division (IN_SCALE) ⇒ inference
If you want to normalize using a procedure other than the above, create a preprocessing script and set it to "PREPRO".
The preprocessing specified as "PREPRO" is not included in the model file. If you incorporate the model into your app, implement preprocessing on the app side as well.
Â
Setting Example :
When normalizing 0 - 255 to 0.0 - 1.0 :
IN_MEAN : 0
IN_SCALE : 255
When normalizing 0 - 255 to -1.0 - 1.0 :
IN_MEAN : 127.5
IN_SCALE : 127.5
When normalization is performed in the preprocessing script (Not include preprocessing in post-conversion model):
IN_MEAN : 0
IN_SCALE : 1
PREPRO : Preprocessing script path
For details, refer to "AdamApp_CVtool_UserManual_Vx_xx.pdf" included with the CV tool.