code: def plot_tracking(
      image,
      tlwhs,
      obj_ids,
      scores=None,
      frame_id=0,
      fps=0.0,
      ids2names=[],
      do_entrance_counting=False,
      entrance=None,
  ):
      im = np.ascontiguousarray(np.copy(image))
      im_h, im_w = im.shape[:2]
  
      text_scale = max(0.5, image.shape[1] / 3000.0)
      text_thickness = 2
      line_thickness = max(1, int(image.shape[1] / 500.0))
  
      cv2.putText(
          im,
          "frame: %d fps: %.2f num: %d" % (frame_id, fps, len(tlwhs)),
          (0, int(15 * text_scale) + 5),
          cv2.FONT_ITALIC,
          text_scale,
          (0, 0, 255),
          thickness=text_thickness,
      )
      for i, tlwh in enumerate(tlwhs):
          x1, y1, w, h = tlwh
          intbox = tuple(map(int, (x1, y1, x1 + w, y1 + h)))
          obj_id = int(obj_ids[i])
          id_text = "ID: {}".format(int(obj_id))
          if ids2names != []:
              assert (
                  len(ids2names) == 1
              ), "plot_tracking only supports single classes."
              id_text = "ID: {}_".format(ids2names[0]) + id_text
          _line_thickness = 1 if obj_id <= 0 else line_thickness
          color = get_color(abs(obj_id))
          cv2.rectangle(
              im,
              intbox[0:2],
              intbox[2:4],
              color=color,
              thickness=line_thickness,
          )
          cv2.putText(
              im,
              id_text,
              (intbox[0], intbox[1] - 25),
              cv2.FONT_ITALIC,
              text_scale,
              (0, 255, 255),
              thickness=text_thickness,
          )
  
          if scores is not None:
              text = "score: {:.2f}".format(float(scores[i]))
              cv2.putText(
                  im,
                  text,
                  (intbox[0], intbox[1] - 6),
                  cv2.FONT_ITALIC,
                  text_scale,
                  (0, 255, 0),
                  thickness=text_thickness,
              )
      if do_entrance_counting:
          entrance_line = tuple(map(int, entrance))
          cv2.rectangle(
              im,
              entrance_line[0:2],
              entrance_line[2:4],
              color=(0, 255, 255),
              thickness=line_thickness,
          )
      return im
  
file_path: PaddleDetection/deploy/pptracking/python/mot/visualize.py
imports: from __future__ import division
  import os
  import cv2
  import numpy
  import PIL
  from PIL import Image, ImageDraw, ImageFile
  from collections import deque
label_desc: Use image node_id 7 for calling a global function with example usage: plot_tracking(image, tlwhs, obj_ids, scores, frame_id, fps, ids2names, do_entrance_counting, entrance) and returns: im