code: def draw_img_and_boxes(
      img: Union[PIL.Image.Image, np.ndarray],
      bboxes: dict,
      class_map,
      display_score: bool = True,
      label_color: Union[np.array, list, tuple, str] = (255, 255, 0),
      label_border_color: Union[np.array, list, tuple, str] = (
          255,
          255,
          0,
      ),
  ) -> PIL.Image.Image:
      img = np.array(img)
  
      # convert dict to record
      record = ObjectDetectionRecord()
      record.img = img
  
      img_size = get_img_size_from_data(img)
      record.set_img_size(img_size)
  
      record.detection.set_class_map(class_map)
  
      for bbox in bboxes:
          record.detection.add_bboxes([BBox.from_xyxy(*bbox["bbox"])])
          record.detection.add_labels([bbox["class"]])
          record.detection.set_scores(bbox["score"])
  
      pred_img = draw_sample(
          record,
          display_score=display_score,
          label_color=label_color,
          label_border_color=label_border_color,
      )
  
      return pred_img
  
file_path: icevision/icevision/models/inference.py
imports: from icevision.imports import *
  from icevision.core import *
  from icevision.data import *
  from icevision.tfms.albumentations.albumentations_helpers import get_size_without_padding
  from icevision.tfms.albumentations import albumentations_adapter
  from icevision.utils.imageio import *
  from icevision.visualize.draw_data import *
  from icevision.visualize.utils import *
  from icevision.utils.imageio import get_img_size_from_data
label_desc: Use image node_id 4 for calling a global function with example usage: draw_img_and_boxes(img, bboxes, class_map, display_score, label_color, label_border_color) and returns: pred_img