code: def draw_box(im, np_boxes, labels):
      """
      Args:
          im (PIL.Image.Image): PIL image
          np_boxes (np.ndarray): shape:[N,6], N: number of box,
                                 matix element:[class, score, x_min, y_min, x_max, y_max]
          labels (list): labels:['class1', ..., 'classn']
      Returns:
          im (PIL.Image.Image): visualized image
      """
      draw_thickness = min(im.size) // 320
      draw = ImageDraw.Draw(im)
      clsid2color = {}
      color_list = get_color_map_list(len(labels))
  
      for dt in np_boxes:
          clsid, bbox, score = int(dt[0]), dt[2:], dt[1]
          xmin, ymin, xmax, ymax = bbox
          w = xmax - xmin
          h = ymax - ymin
          if clsid not in clsid2color:
              clsid2color[clsid] = color_list[clsid]
          color = tuple(clsid2color[clsid])
  
          # draw bbox
          draw.line(
              [
                  (xmin, ymin),
                  (xmin, ymax),
                  (xmax, ymax),
                  (xmax, ymin),
                  (xmin, ymin),
              ],
              width=draw_thickness,
              fill=color,
          )
  
          # draw label
          text = "{} {:.4f}".format(labels[clsid], score)
          tw, th = draw.textsize(text)
          draw.rectangle(
              [(xmin + 1, ymin - th), (xmin + tw + 1, ymin)], fill=color
          )
          draw.text((xmin + 1, ymin - th), text, fill=(255, 255, 255))
      return im
  
file_path: PaddleHub/modules/image/instance_segmentation/solov2/data_feed.py
imports: import base64
  import cv2
  import numpy
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from paddle.inference import PrecisionType
  from PIL import Image
  from PIL import ImageDraw
label_desc: Use image node_id 6 for calling a global function with example usage: draw_box(im, np_boxes, labels) and returns: im