docstr: Define one of gt_boxes or rpn_bbox_pred.
  
  If using gt_boxes, the correct rpn_bbox_pred for those gt_boxes will
  be used.
docstr_tok: ["Define","one","of","gt_boxes","or","rpn_bbox_pred",".","If","using","gt_boxes",",","the","correct","rpn_bbox_pred","for","those","gt_boxes","will","be","used","."]
code: def _run_rpn_proposal(
      self,
      all_anchors,
      rpn_cls_prob,
      config,
      gt_boxes=None,
      rpn_bbox_pred=None,
  ):
      """
      Define one of gt_boxes or rpn_bbox_pred.
  
      If using gt_boxes, the correct rpn_bbox_pred for those gt_boxes will
      be used.
      """
      feed_dict = {}
      rpn_cls_prob_tf = tf.placeholder(
          tf.float32, shape=(all_anchors.shape[0], 2)
      )
      feed_dict[rpn_cls_prob_tf] = rpn_cls_prob
      im_size_tf = tf.placeholder(tf.float32, shape=(2,))
      feed_dict[im_size_tf] = self.im_size
      all_anchors_tf = tf.placeholder(
          tf.float32, shape=all_anchors.shape
      )
      feed_dict[all_anchors_tf] = all_anchors
      if rpn_bbox_pred is None and gt_boxes is not None:
          # Here we encode 'all_anchors' and 'gt_boxes' to get corrects
          # predictions that RPNProposal can decodes.
          rpn_bbox_pred_tf = encode(all_anchors, gt_boxes)
      else:
          rpn_bbox_pred_tf = tf.placeholder(
              tf.float32, shape=rpn_bbox_pred.shape
          )
          feed_dict[rpn_bbox_pred_tf] = rpn_bbox_pred
  
      model = RPNProposal(all_anchors.shape[0], config, debug=True)
      results = model(
          rpn_cls_prob_tf, rpn_bbox_pred_tf, all_anchors_tf, im_size_tf
      )
  
      with self.test_session() as sess:
          results = sess.run(results, feed_dict=feed_dict)
          return results
  
file_path: luminoth/luminoth/models/fasterrcnn/rpn_proposal_test.py
imports: import numpy
  import tensorflow
  from easydict import EasyDict
  from luminoth.models.fasterrcnn.rpn_proposal import RPNProposal
  from luminoth.utils.bbox_transform_tf import encode, clip_boxes
label_desc: Use image node_id 2 for calling the RPNProposalTest obj's underlying member method code with example usage: obj._run_rpn_proposal(all_anchors, rpn_cls_prob, config, gt_boxes, rpn_bbox_pred) and returns: results