Do images still need to be preprocessed when using tflite in an app?

612

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

Share:
612
Keeran Parthipan
Author by

Keeran Parthipan

Updated on December 22, 2022

Comments

  • Keeran Parthipan
    Keeran Parthipan over 1 year

    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 :-)