code: def draw_box(
      image,
      boxes,
      classes,
      scores,
      category_index,
      thresh=0.5,
      line_thickness=8,
  ):
      box_to_display_str_map = collections.defaultdict(list)
      box_to_color_map = collections.defaultdict(str)
  
      filter_low_thresh(
          boxes,
          scores,
          classes,
          category_index,
          thresh,
          box_to_display_str_map,
          box_to_color_map,
      )
  
      # Draw all boxes onto image.
      for box, color in box_to_color_map.items():
          ymin, xmin, ymax, xmax = box
          image_pil = Image.fromarray(np.uint8(image)).convert("RGB")
          draw = ImageDraw.Draw(image_pil)
          im_width, im_height = image_pil.size
          (left, right, top, bottom) = (
              xmin * im_width,
              xmax * im_width,
              ymin * im_height,
              ymax * im_height,
          )
          draw.line(
              [
                  (left, top),
                  (left, bottom),
                  (right, bottom),
                  (right, top),
                  (left, top),
              ],
              width=line_thickness,
              fill=color,
          )
          draw_text(
              draw,
              box_to_display_str_map,
              box,
              left,
              right,
              top,
              bottom,
              color,
          )
          np.copyto(image, np.array(image_pil))
      return image
  
file_path: deep-learning-for-image-processing/others_project/readPbFile/using_function.py
imports: import collections
  import six
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageFont
  import numpy
  import tensorflow
  import cv2
label_desc: Use image node_id 3 for calling a global function with example usage: draw_box(image, boxes, classes, scores, category_index, thresh, line_thickness) and returns: image