code: def draw_bounding_box_on_image(save_im_path, output_data):
      image = Image.open(save_im_path)
      draw = ImageDraw.Draw(image)
      for bbox in output_data:
          # draw bouding box
          if bbox["label"] == "MASK":
              draw.line(
                  [
                      (bbox["left"], bbox["top"]),
                      (bbox["left"], bbox["bottom"]),
                      (bbox["right"], bbox["bottom"]),
                      (bbox["right"], bbox["top"]),
                      (bbox["left"], bbox["top"]),
                  ],
                  width=2,
                  fill="green",
              )
          else:
              draw.line(
                  [
                      (bbox["left"], bbox["top"]),
                      (bbox["left"], bbox["bottom"]),
                      (bbox["right"], bbox["bottom"]),
                      (bbox["right"], bbox["top"]),
                      (bbox["left"], bbox["top"]),
                  ],
                  width=2,
                  fill="red",
              )
          # draw label
          text = bbox["label"] + ": %.2f%%" % (100 * bbox["confidence"])
          textsize_width, textsize_height = draw.textsize(text=text)
          if image.mode == "RGB" or image.mode == "RGBA":
              box_fill = (255, 255, 255)
              text_fill = (0, 0, 0)
          else:
              box_fill = 255
              text_fill = 0
  
          draw.rectangle(
              xy=(
                  bbox["left"],
                  bbox["top"] - (textsize_height + 5),
                  bbox["left"] + textsize_width + 10,
                  bbox["top"] - 3,
              ),
              fill=box_fill,
          )
          draw.text(
              xy=(bbox["left"], bbox["top"] - 15),
              text=text,
              fill=text_fill,
          )
      image.save(save_im_path)
  
file_path: PaddleHub/modules/image/face_detection/pyramidbox_lite_server_mask/processor.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import base64
  import os
  import time
  import cv2
  import numpy
  from PIL import Image
  from PIL import ImageDraw
label_desc: Use image node_id 4 for calling a global function with example usage: draw_bounding_box_on_image(save_im_path, output_data) without return types