code: def plot_predictions(image, boxes, labels):
      for box, label in zip(boxes, labels):
          # Bounding box around artefacts
          cv2.rectangle(
              image, (box[0], box[1]), (box[2], box[3]), CM[label], 2
          )
          text_size, _ = cv2.getTextSize(
              CLASSES[label], cv2.FONT_HERSHEY_SIMPLEX, 2, 2
          )
          text_w, text_h = text_size
          # Filled rectangle above bounding box
          cv2.rectangle(
              image,
              (box[0], box[1]),
              (box[0] + text_w, box[1] - text_h),
              CM[label],
              -1,
          )
          # Text bearing the name of the artefact detected
          cv2.putText(
              image,
              CLASSES[label],
              (int(box[0]), int(box[1])),
              cv2.FONT_HERSHEY_SIMPLEX,
              2,
              (255, 255, 255),
              3,
          )
      plt.axis("off")
      plt.imshow(image)
      plt.show()
  
file_path: doctr/scripts/detect_artefacts.py
imports: import os
  import argparse
  import logging
  import cv2
  import matplotlib.pyplot
  import torch
  from doctr.io.image import read_img_as_tensor
  from doctr.models import obj_detection
label_desc: Use image node_id 1 for calling a global function with example usage: plot_predictions(image, boxes, labels) without return types