code: def add_boxes(img, prediction):
      if isinstance(prediction, int):  # no predictions
          return img
      coco_labels = fetch(
          "https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names"
      ).read_bytes()
      coco_labels = coco_labels.decode("utf-8").split("\n")
      height, width = img.shape[0:2]
      scale_factor = 608 / width
      prediction[:, [1, 3]] -= (608 - scale_factor * width) / 2
      prediction[:, [2, 4]] -= (608 - scale_factor * height) / 2
      for pred in prediction:
          corner1 = tuple(pred[1:3].astype(int))
          corner2 = tuple(pred[3:5].astype(int))
          w = corner2[0] - corner1[0]
          h = corner2[1] - corner1[1]
          corner2 = (corner2[0] + w, corner2[1] + h)
          label = coco_labels[int(pred[-1])]
          img = cv2.rectangle(img, corner1, corner2, (255, 0, 0), 2)
          t_size = cv2.getTextSize(label, cv2.FONT_HERSHEY_PLAIN, 1, 1)[
              0
          ]
          c2 = corner1[0] + t_size[0] + 3, corner1[1] + t_size[1] + 4
          img = cv2.rectangle(img, corner1, c2, (255, 0, 0), -1)
          img = cv2.putText(
              img,
              label,
              (corner1[0], corner1[1] + t_size[1] + 4),
              cv2.FONT_HERSHEY_PLAIN,
              1,
              [225, 255, 255],
              1,
          )
      return img
  
imports: import sys
  import io
  import time
  import math
  import cv2
  import numpy
  from PIL import Image
  from tinygrad.tensor import Tensor
  from tinygrad.nn import BatchNorm2d, Conv2d
  from tinygrad.helpers import fetch
label_desc: Use image node_id 2 for calling a global function with example usage: add_boxes(img, prediction) and returns: img, img