code: def draw_re_results(
      image, result, font_path="doc/fonts/simfang.ttf", font_size=18
  ):
      np.random.seed(0)
      if isinstance(image, np.ndarray):
          image = Image.fromarray(image)
      elif isinstance(image, str) and os.path.isfile(image):
          image = Image.open(image).convert("RGB")
      img_new = image.copy()
      draw = ImageDraw.Draw(img_new)
  
      font = ImageFont.truetype(font_path, font_size, encoding="utf-8")
      color_head = (0, 0, 255)
      color_tail = (255, 0, 0)
      color_line = (0, 255, 0)
  
      for ocr_info_head, ocr_info_tail in result:
          draw_box_txt(
              ocr_info_head["bbox"],
              ocr_info_head["transcription"],
              draw,
              font,
              font_size,
              color_head,
          )
          draw_box_txt(
              ocr_info_tail["bbox"],
              ocr_info_tail["transcription"],
              draw,
              font,
              font_size,
              color_tail,
          )
  
          center_head = (
              (ocr_info_head["bbox"][0] + ocr_info_head["bbox"][2])
              // 2,
              (ocr_info_head["bbox"][1] + ocr_info_head["bbox"][3])
              // 2,
          )
          center_tail = (
              (ocr_info_tail["bbox"][0] + ocr_info_tail["bbox"][2])
              // 2,
              (ocr_info_tail["bbox"][1] + ocr_info_tail["bbox"][3])
              // 2,
          )
  
          draw.line(
              [center_head, center_tail], fill=color_line, width=5
          )
  
      img_new = Image.blend(image, img_new, 0.5)
      return np.array(img_new)
  
file_path: PaddleOCR/ppocr/utils/visual.py
imports: import cv2
  import os
  import numpy
  from PIL import Image, ImageDraw, ImageFont
label_desc: Use image node_id 4 for calling a global function with example usage: draw_re_results(image, result, font_path, font_size) and returns: np