code: def proposal_metrics(iou):
      """
      Add summaries for RPN proposals.
  
      Args:
          iou: nxm, #proposal x #gt
      """
      # find best roi for each gt, for summary only
      best_iou = tf.reduce_max(iou, axis=0)
      mean_best_iou = tf.reduce_mean(best_iou, name="best_iou_per_gt")
      summaries = [mean_best_iou]
      with tf.device("/cpu:0"):
          for th in [0.3, 0.5]:
              recall = tf.truediv(
                  tfv1.count_nonzero(best_iou >= th),
                  tf.size(best_iou, out_type=tf.int64),
                  name="recall_iou{}".format(th),
              )
              summaries.append(recall)
      add_moving_summary(*summaries)
  
imports: import tensorflow
  from tensorpack import tfv1
  from tensorpack.models import Conv2D, FullyConnected, layer_register
  from tensorpack.tfutils.argscope import argscope
  from tensorpack.tfutils.scope_utils import under_name_scope
  from tensorpack.tfutils.summary import add_moving_summary
  from tensorpack.utils.argtools import memoized_method
  from config import config
  from utils.box_ops import pairwise_iou
  from .model_box import decode_bbox_target, encode_bbox_target
  from .backbone import GroupNorm
label_desc: Use image node_id 1 for calling a global function with example usage: proposal_metrics(iou) without return types