code: def decode_image(img_path):
      with open(img_path, "rb") as f:
          im_read = f.read()
      data = np.frombuffer(im_read, dtype="uint8")
      im = cv2.imdecode(data, 1)  # BGR mode, but need RGB mode
      im = cv2.cvtColor(im, cv2.COLOR_BGR2RGB)
      img_info = {
          "im_shape": np.array(im.shape[:2], dtype=np.float32),
          "scale_factor": np.array([1.0, 1.0], dtype=np.float32),
      }
      return im, img_info
  
imports: import numpy
  import cv2
  import copy
label_desc: Use image node_id 1 for calling a global function with example usage: decode_image(img_path) and returns: im,  img_info