text: import tensorflow as tf
  from configuration import IMAGE_WIDTH, IMAGE_HEIGHT, CHANNELS
  
  
  def preprocess_image(img_path):
      # read pictures
      img_raw = tf.io.read_file(img_path)
      # decode pictures
      img_tensor = tf.image.decode_jpeg(img_raw, channels=CHANNELS)
      # resize
      img_tensor = tf.image.resize(img_tensor, [IMAGE_HEIGHT, IMAGE_WIDTH])
      img_tensor = tf.cast(img_tensor, tf.float32)
      # normalization
      img = img_tensor / 255.0
      return img
  