code: def draw_correct_rpn_proposals_anchors(pred_dict, image, top_k=5):
      scores = pred_dict["rpn_prediction"]["rpn_cls_prob"]
      scores = scores[:, 1]
      bbox_pred = pred_dict["rpn_prediction"]["rpn_bbox_pred"]
      all_anchors = pred_dict["all_anchors"]
      gt_bboxes = pred_dict["gt_bboxes"]
      bboxes = decode(all_anchors, bbox_pred)
  
      gt_overlap = bbox_overlap(bboxes, gt_bboxes[:, :4])
      top_idxs = gt_overlap.max(axis=1).argsort()[::-1][:top_k]
      bboxes = bboxes[top_idxs]
      all_anchors = all_anchors[top_idxs]
      scores = scores[top_idxs]
  
      image_pil, draw = get_image_draw(image)
  
      for bbox, anchor, score in zip(bboxes, all_anchors, scores):
          bbox = list(bbox)
          anchor = list(anchor)
          draw.rectangle(
              bbox, fill=(0, 255, 50, 20), outline=(0, 255, 50, 100)
          )
          draw.rectangle(
              anchor, fill=(0, 50, 255, 20), outline=(0, 50, 255, 100)
          )
          draw.text(
              tuple([bbox[0], bbox[1]]),
              text="{:.2f}".format(score)[1:],
              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 28 for calling a global function with example usage: draw_correct_rpn_proposals_anchors(pred_dict, image, top_k) and returns: image_pil