code: def draw_boxes(image, boxes, labels, obj_thresh, quiet=True):
      for box in boxes:
          label_str = ""
          label = -1
  
          for i in range(len(labels)):
              if box.classes[i] > obj_thresh:
                  if label_str != "":
                      label_str += ", "
                  label_str += (
                      labels[i]
                      + " "
                      + str(round(box.get_score() * 100, 2))
                      + "%"
                  )
                  label = i
              if not quiet:
                  print(label_str)
  
          if label >= 0:
              text_size = cv2.getTextSize(
                  label_str,
                  cv2.FONT_HERSHEY_SIMPLEX,
                  1.1e-3 * image.shape[0],
                  5,
              )
              width, height = text_size[0][0], text_size[0][1]
              region = np.array(
                  [
                      [box.xmin - 3, box.ymin],
                      [box.xmin - 3, box.ymin - height - 26],
                      [box.xmin + width + 13, box.ymin - height - 26],
                      [box.xmin + width + 13, box.ymin],
                  ],
                  dtype="int32",
              )
  
              cv2.rectangle(
                  img=image,
                  pt1=(box.xmin, box.ymin),
                  pt2=(box.xmax, box.ymax),
                  color=get_color(label),
                  thickness=5,
              )
              cv2.fillPoly(
                  img=image, pts=[region], color=get_color(label)
              )
              cv2.putText(
                  img=image,
                  text=label_str,
                  org=(box.xmin + 13, box.ymin - 13),
                  fontFace=cv2.FONT_HERSHEY_SIMPLEX,
                  fontScale=1e-3 * image.shape[0],
                  color=(0, 0, 0),
                  thickness=2,
              )
  
      return image
  
file_path: ImageAI/imageai_tf_deprecated/Detection/Custom/utils/bbox.py
imports: import numpy
  import os
  import cv2
  from .colors import get_color
label_desc: Use image node_id 3 for calling a global function with example usage: draw_boxes(image, boxes, labels, obj_thresh, quiet) and returns: image