code: def visualize_box(im, results, labels, threshold=0.5):
      """
      Args:
          im (str/np.ndarray): path of image/np.ndarray read by cv2
          results (dict): include 'boxes': np.ndarray: shape:[N,6], N: number of box,
                          matix element:[class, score, x_min, y_min, x_max, y_max]
                          MaskRCNN's results include 'masks': np.ndarray:
                          shape:[N, im_h, im_w]
          labels (list): labels:['class1', ..., 'classn']
          threshold (float): Threshold of score.
      Returns:
          im (PIL.Image.Image): visualized image
      """
      if isinstance(im, str):
          im = Image.open(im).convert("RGB")
      elif isinstance(im, np.ndarray):
          im = Image.fromarray(im)
      if "boxes" in results and len(results["boxes"]) > 0:
          im = draw_box(
              im, results["boxes"], labels, threshold=threshold
          )
      return im
  
file_path: PaddleHub/modules/image/keypoint_detection/pp-tinypose/visualize.py
imports: from __future__ import division
  import math
  import os
  import cv2
  import numpy
  from PIL import Image
  from PIL import ImageDraw
  from PIL import ImageFile
label_desc: Use image node_id 1 for calling a global function with example usage: visualize_box(im, results, labels, threshold) and returns: im