docstr: Args:
      boxes: Nx4
  Returns:
      BoxProposals
docstr_tok: ["Args",":","boxes",":","Nx4","Returns",":","BoxProposals"]
code: def match_box_with_gt(self, boxes, iou_threshold):
      """
      Args:
          boxes: Nx4
      Returns:
          BoxProposals
      """
      if self.training:
          with tf.name_scope(
              "match_box_with_gt_{}".format(iou_threshold)
          ):
              iou = pairwise_iou(boxes, self.gt_boxes)  # NxM
              max_iou_per_box = tf.reduce_max(iou, axis=1)  # N
              best_iou_ind = tf.cond(
                  tf.shape(iou)[1] > 0,
                  lambda: tf.argmax(
                      iou, axis=1
                  ),  # #proposal, each in 0~m-1
                  lambda: tf.zeros(tf.shape(iou)[0], dtype=tf.int64),
              )
              labels_per_box = tf.gather(self.gt_labels, best_iou_ind)
              fg_mask = max_iou_per_box >= iou_threshold
              fg_inds_wrt_gt = tf.boolean_mask(best_iou_ind, fg_mask)
              labels_per_box = tf.stop_gradient(
                  labels_per_box * tf.cast(fg_mask, tf.int64)
              )
              return BoxProposals(boxes, labels_per_box, fg_inds_wrt_gt)
      else:
          return BoxProposals(boxes)
  
file_path: tensorpack/examples/FasterRCNN/modeling/model_cascade.py
imports: import tensorflow
  from tensorpack.tfutils import get_current_tower_context
  from config import config
  from utils.box_ops import pairwise_iou, area
  from .model_box import clip_boxes
  from .model_frcnn import BoxProposals, FastRCNNHead, fastrcnn_outputs
label_desc: Use image node_id 3 for calling the CascadeRCNNHead obj's underlying member method code with example usage: obj.match_box_with_gt(boxes, iou_threshold) and returns: BoxProposals, BoxProposals