code: def prepare_image(
      image: np.ndarray, inp_dim: Tuple[int, int]
  ) -> torch.Tensor:
      """
      Prepared the input to match the expectation of the network.
      """
      img = letterbox_image(image, inp_dim)
      img = img[:, :, ::-1].transpose((2, 0, 1)).copy()
      img = torch.from_numpy(img).float().div(255.0).unsqueeze(0)
      return img
  
file_path: ImageAI/imageai/yolov3/utils.py
imports: import math
  from typing import Union, List, Tuple
  import torch
  import numpy
  import cv2
  from torchvision.ops import batched_nms
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_image(image, inp_dim) and returns: img