Reputation: 33
When saving a tensorflow-lite model, does extra information get saved as well as the model architecture? For example, image size, range of pixel values, etc.
Suppose that my model was trained on normalized images that had an RGB spectrum and were 100 *100 pixels in size. Do I need to explicitly preprocess the images before performing inference in Android Studio / Flutter? Or does the tflite plugin automatically do this?
Thanks :-)
Upvotes: 2
Views: 926
Reputation: 3845
Yes, you need to preprocess the images in your app side to the same format as the images used for training, before passing them to the TFLite model.
An example of this preprocessing step is explained here: https://github.com/tensorflow/examples/blob/master/lite/examples/image_classification/android/EXPLORE_THE_CODE.md#pre-process-bitmap-image
Upvotes: 1