code: def resize_image(img):
      """Resize image and make it fit for network.
  
      Args:
          img (array): image
  
      Returns:
          tensor: data ready for network
      """
      height_orig = img.shape[0]
      width_orig = img.shape[1]
  
      if width_orig > height_orig:
          scale = width_orig / 384
      else:
          scale = height_orig / 384
  
      height = (np.ceil(height_orig / scale / 32) * 32).astype(int)
      width = (np.ceil(width_orig / scale / 32) * 32).astype(int)
  
      img_resized = cv2.resize(
          img, (width, height), interpolation=cv2.INTER_AREA
      )
  
      img_resized = (
          torch.from_numpy(np.transpose(img_resized, (2, 0, 1)))
          .contiguous()
          .float()
      )
      img_resized = img_resized.unsqueeze(0)
  
      return img_resized
  
file_path: stablediffusion/ldm/modules/midas/utils.py
imports: import sys
  import re
  import numpy
  import cv2
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: resize_image(img) and returns: img_resized