code: def draw_rpn_bbox_targets(pred_dict, image):
      target = pred_dict["rpn_prediction"]["rpn_cls_target"]
      bbox_target = pred_dict["rpn_prediction"]["rpn_bbox_target"]
      all_anchors = pred_dict["all_anchors"]
  
      batch_foreground_idxs = target == 1
      bbox_target = bbox_target[batch_foreground_idxs]
      all_anchors = all_anchors[batch_foreground_idxs]
  
      gt_boxes = decode(all_anchors, bbox_target)
  
      image_pil, draw = get_image_draw(image)
  
      for gt_box in gt_boxes:
          draw.rectangle(
              list(gt_box),
              fill=(30, 0, 240, 20),
              outline=(30, 0, 240, 100),
          )
  
      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 21 for calling a global function with example usage: draw_rpn_bbox_targets(pred_dict, image) and returns: image_pil