code: def _draw_single_box(
      image,
      xmin,
      ymin,
      xmax,
      ymax,
      display_str,
      color="black",
      color_text="black",
      thickness=2,
  ):
      from PIL import ImageDraw, ImageFont
  
      font = ImageFont.load_default()
      draw = ImageDraw.Draw(image)
      (left, right, top, bottom) = (xmin, xmax, ymin, ymax)
      draw.line(
          [
              (left, top),
              (left, bottom),
              (right, bottom),
              (right, top),
              (left, top),
          ],
          width=thickness,
          fill=color,
      )
      if display_str:
          text_bottom = bottom
          # Reverse list and print from bottom to top.
          l, t, r, b = font.getbbox(display_str)
          text_width, text_height = r - l, b - t
          margin = np.ceil(0.05 * text_height)
          draw.rectangle(
              [
                  (left, text_bottom - text_height - 2 * margin),
                  (left + text_width, text_bottom),
              ],
              fill=color,
          )
          draw.text(
              (left + margin, text_bottom - text_height - margin),
              display_str,
              fill=color_text,
              font=font,
          )
      return image
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import numpy
  import os
  import re
  from .proto.summary_pb2 import Summary
  from .proto.summary_pb2 import HistogramProto
  from .proto.summary_pb2 import SummaryMetadata
  from .proto.tensor_pb2 import TensorProto
  from .proto.tensor_shape_pb2 import TensorShapeProto
  from .proto.plugin_pr_curve_pb2 import PrCurvePluginData
  from .proto.plugin_text_pb2 import TextPluginData
  from .proto.plugin_mesh_pb2 import MeshPluginData
  from .proto import layout_pb2
  from .x2num import make_np
  from .utils import _prepare_video, convert_to_HWC, convert_to_NTCHW
label_desc: Use image node_id 2 for calling a global function with example usage: _draw_single_box(image, xmin, ymin, xmax, ymax, display_str, color, color_text, thickness) and returns: image