code: def read_tensor_from_image_file(
      file_name,
      input_height=299,
      input_width=299,
      input_mean=0,
      input_std=255,
  ):
      input_name = "file_reader"
      output_name = "normalized"
      file_reader = tf.io.read_file(file_name, input_name)
      if file_name.endswith(".png"):
          image_reader = tf.io.decode_png(
              file_reader, channels=3, name="png_reader"
          )
      elif file_name.endswith(".gif"):
          image_reader = tf.squeeze(
              tf.io.decode_gif(file_reader, name="gif_reader")
          )
      elif file_name.endswith(".bmp"):
          image_reader = tf.io.decode_bmp(
              file_reader, name="bmp_reader"
          )
      else:
          image_reader = tf.io.decode_jpeg(
              file_reader, channels=3, name="jpeg_reader"
          )
      float_caster = tf.cast(image_reader, tf.float32)
      dims_expander = tf.expand_dims(float_caster, 0)
      resized = tf.compat.v1.image.resize_bilinear(
          dims_expander, [input_height, input_width]
      )
      normalized = tf.divide(
          tf.subtract(resized, [input_mean]), [input_std]
      )
      sess = tf.compat.v1.Session()
      return sess.run(normalized)
  
imports: import argparse
  import numpy
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: read_tensor_from_image_file(file_name, input_height, input_width, input_mean, input_std) and returns: sess