code: def resize_augmenter(image, annotation, output_shape):
      resize_method = _DEFAULT_AUG_PARAMS["resize_method"]
  
      def resize_PIL_image(image, output_shape):
          image *= 255.0
          image = image.astype("uint8")
          pil_img = Image.fromarray(image)
          resize_img = pil_img.resize(
              (output_shape[1], output_shape[0]),
              resample=Image.BILINEAR,
          )
          np_img = np.array(resize_img)
          np_img = np_img.astype(np.float32)
          np_img /= 255.0
          return np_img
  
      def resize_turicreate_image(image, output_shape):
          image *= 255.0
          image = image.astype("uint8")
          FORMAT_RAW = 2
          tc_image = tc.Image(
              _image_data=image.tobytes(),
              _width=image.shape[1],
              _height=image.shape[0],
              _channels=image.shape[2],
              _format_enum=FORMAT_RAW,
              _image_data_size=image.size,
          )
          tc_image = tc.image_analysis.resize(
              tc_image,
              output_shape[1],
              output_shape[0],
              resample="bilinear",
          )
          image = tc_image.pixel_data
          image = image.astype(np.float32)
          image /= 255.0
          return image
  
      if resize_method == "tensorflow":
          tf = _lazy_import_tensorflow()
          new_height = tf.cast(output_shape[0], dtype=tf.int32)
          new_width = tf.cast(output_shape[1], dtype=tf.int32)
  
          # Determine the affine transform to apply and apply to the image itself.
          image_scaled = tf.squeeze(
              tf.image.resize_bilinear(
                  tf.expand_dims(image, 0), [new_height, new_width]
              ),
              [0],
          )
  
      elif resize_method == "PIL":
          image_scaled = tf.numpy_function(
              func=resize_PIL_image,
              inp=[image, output_shape],
              Tout=[tf.float32],
          )
  
      elif resize_method == "turicreate":
          tf = _lazy_import_tensorflow()
          image_scaled = tf.numpy_function(
              func=resize_turicreate_image,
              inp=[image, output_shape],
              Tout=[tf.float32],
          )
  
      else:
          raise Exception("Non-supported resize method.")
  
      image_clipped = tf.clip_by_value(image_scaled, 0.0, 1.0)
  
      # No geometry changes (because of relative co-ordinate system)
      return image_clipped, annotation
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from PIL import Image
  import turicreate.toolkits._tf_utils
  import turicreate
  from turicreate._deps.minimal_package import _minimal_package_import_check
label_desc: Use image node_id 5 for calling a global function with example usage: resize_augmenter(image, annotation, output_shape) and returns: image_clipped,  annotation, np_img, image