code: def draw_object_prediction(pred_dict, image, topn=50):
      logger.debug("Display top scored objects with label.")
      objects = pred_dict["classification_prediction"]["objects"]
      objects_labels = pred_dict["classification_prediction"]["labels"]
      objects_labels_prob = pred_dict["classification_prediction"][
          "probs"
      ]
  
      if len(objects_labels) == 0:
          logger.debug(
              "No objects detected. Probably all classified as background."
          )
  
      image_pil, draw = get_image_draw(image)
  
      for num_object, (object_, label, prob) in enumerate(
          zip(objects, objects_labels, objects_labels_prob)
      ):
          bbox = list(object_)
          draw.rectangle(
              bbox, fill=(0, 255, 0, 20), outline=(0, 255, 0, 100)
          )
          draw.text(
              tuple([bbox[0], bbox[1]]),
              text="{} - {:.2f}".format(label, prob),
              font=font,
              fill=(0, 0, 0, 255),
          )
  
      # bboxes, classes = recalculate_objects(pred_dict)
      # for bbox, label in zip(bboxes, classes):
      #     bbox = list(bbox)
      #     draw.rectangle(bbox, fill=(0, 255, 0, 20), outline=(0, 255, 0, 100))
      #     draw.text(tuple([bbox[0], bbox[1]]), text='{}'.format(label),
      #           font=font, fill=(0, 0, 0, 255))
  
      return image_pil
  
imports: import io
  import numpy
  import os
  import logging
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageFont
  import tensorflow
  from .bbox_overlap import bbox_overlap
  from .bbox_transform import decode
  from base64 import b64encode
  from sys import stdout
label_desc: Use image node_id 27 for calling a global function with example usage: draw_object_prediction(pred_dict, image, topn) and returns: image_pil