code: def decode_image(im_file, im_info):
      """read rgb image
      Args:
          im_file (str|np.ndarray): input can be image path or np.ndarray
          im_info (dict): info of image
      Returns:
          im (np.ndarray):  processed image (np.ndarray)
          im_info (dict): info of processed image
      """
      if isinstance(im_file, str):
          with open(im_file, "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)
      else:
          im = im_file
      im_info["im_shape"] = np.array(im.shape[:2], dtype=np.float32)
      im_info["scale_factor"] = np.array([1.0, 1.0], dtype=np.float32)
      return im, im_info
  
imports: import cv2
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: decode_image(im_file, im_info) and returns: im,  im_info