code: def draw_server_result(image_file, res):
      img = cv2.imread(image_file)
      image = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
      if len(res) == 0:
          return np.array(image)
      keys = res[0].keys()
      if (
          "text_region" not in keys
      ):  # for ocr_rec, draw function is invalid
          logger.info("draw function is invalid for ocr_rec!")
          return None
      elif "text" not in keys:  # for ocr_det
          logger.info("draw text boxes only!")
          boxes = []
          for dno in range(len(res)):
              boxes.append(res[dno]["text_region"])
          boxes = np.array(boxes)
          draw_img = draw_boxes(image, boxes)
          return draw_img
      else:  # for ocr_system
          logger.info("draw boxes and texts!")
          boxes = []
          texts = []
          scores = []
          for dno in range(len(res)):
              boxes.append(res[dno]["text_region"])
              texts.append(res[dno]["text"])
              scores.append(res[dno]["confidence"])
          boxes = np.array(boxes)
          scores = np.array(scores)
          draw_img = draw_ocr(
              image, boxes, texts, scores, draw_txt=True, drop_score=0.5
          )
          return draw_img
  
file_path: PaddleOCR/tools/test_hubserving.py
imports: import os
  import sys
  from ppocr.utils.logging import get_logger
  import cv2
  import numpy
  import time
  from PIL import Image
  from ppocr.utils.utility import get_image_file_list
  from tools.infer.utility import draw_ocr, draw_boxes, str2bool
  from ppstructure.utility import draw_structure_result
  from ppstructure.predict_system import to_excel
  import requests
  import json
  import base64
label_desc: Use image node_id 2 for calling a global function with example usage: draw_server_result(image_file, res) and returns: np, None, draw_img, draw_img