code: def resize_image_fixed(image, new_height, new_width, bboxes=None):
      image_shape = tf.to_float(tf.shape(image))
      height = image_shape[0]
      width = image_shape[1]
  
      scale_factor_height = new_height / height
      scale_factor_width = new_width / width
  
      # Resize image using TensorFlow's own `resize_image` utility.
      image = tf.image.resize_images(
          image,
          tf.stack(tf.to_int32([new_height, new_width])),
          method=tf.image.ResizeMethod.BILINEAR,
      )
  
      if bboxes is not None:
          bboxes = adjust_bboxes(
              bboxes,
              old_height=height,
              old_width=width,
              new_height=new_height,
              new_width=new_width,
          )
          return {
              "image": image,
              "bboxes": bboxes,
              "scale_factor": (scale_factor_height, scale_factor_width),
          }
  
      return {
          "image": image,
          "scale_factor": (scale_factor_height, scale_factor_width),
      }
  
file_path: luminoth/luminoth/utils/image.py
imports: import tensorflow
  from luminoth.utils.bbox_transform_tf import clip_boxes
label_desc: Use image node_id 3 for calling a global function with example usage: resize_image_fixed(image, new_height, new_width, bboxes) and returns: dict, dict