class_docstr: RPN Head
  
  Args:
      anchor_generator (object): `AnchorGenerator` instance
      rpn_target_assign (object): `RPNTargetAssign` instance
      train_proposal (object): `GenerateProposals` instance for training
      test_proposal (object): `GenerateProposals` instance for testing
      num_classes (int): number of classes in rpn output
docstr: Get proposals according to the output of backbone.
  
  Args:
      body_feats (dict): The dictionary of feature maps from backbone.
      im_info(Variable): The information of image with shape [N, 3] with
          shape (height, width, scale).
      body_feat_names(list): A list of names of feature maps from
          backbone.
  
  Returns:
      rpn_rois(Variable): Output proposals with shape of (rois_num, 4).
docstr_tok: ["Get","proposals","according","to","the","output","of","backbone",".","Args",":","body_feats","(","dict",")",":","The","dictionary","of","feature","maps","from","backbone",".","im_info","(","Variable",")",":","The","information","of","image","with","shape","[","N",",","3","]","with","shape","(","height",",","width",",","scale",")",".","body_feat_names","(","list",")",":","A","list","of","names","of","feature","maps","from","backbone",".","Returns",":","rpn_rois","(","Variable",")",":","Output","proposals","with","shape","of","(","rois_num",",","4",")","."]
code: def get_proposals(self, body_feats, im_info, mode="train"):
      """
      Get proposals according to the output of backbone.
  
      Args:
          body_feats (dict): The dictionary of feature maps from backbone.
          im_info(Variable): The information of image with shape [N, 3] with
              shape (height, width, scale).
          body_feat_names(list): A list of names of feature maps from
              backbone.
  
      Returns:
          rpn_rois(Variable): Output proposals with shape of (rois_num, 4).
      """
      # In RPN Heads, only the last feature map of backbone is used.
      # And body_feat_names[-1] represents the last level name of backbone.
      body_feat = list(body_feats.values())[-1]
      rpn_cls_score, rpn_bbox_pred = self._get_output(body_feat)
  
      if self.num_classes == 1:
          rpn_cls_prob = fluid.layers.sigmoid(
              rpn_cls_score, name="rpn_cls_prob"
          )
      else:
          rpn_cls_score = fluid.layers.transpose(
              rpn_cls_score, perm=[0, 2, 3, 1]
          )
          rpn_cls_score = fluid.layers.reshape(
              rpn_cls_score, shape=(0, 0, 0, -1, self.num_classes)
          )
          rpn_cls_prob_tmp = fluid.layers.softmax(
              rpn_cls_score, use_cudnn=False, name="rpn_cls_prob"
          )
          rpn_cls_prob_slice = fluid.layers.slice(
              rpn_cls_prob_tmp,
              axes=[4],
              starts=[1],
              ends=[self.num_classes],
          )
          rpn_cls_prob, _ = fluid.layers.topk(rpn_cls_prob_slice, 1)
          rpn_cls_prob = fluid.layers.reshape(
              rpn_cls_prob, shape=(0, 0, 0, -1)
          )
          rpn_cls_prob = fluid.layers.transpose(
              rpn_cls_prob, perm=[0, 3, 1, 2]
          )
      prop_op = (
          self.train_proposal if mode == "train" else self.test_proposal
      )
      # prop_op
      rpn_rois, rpn_roi_probs = fluid.layers.generate_proposals(
          scores=rpn_cls_prob,
          bbox_deltas=rpn_bbox_pred,
          im_info=im_info,
          anchors=self.anchor,
          variances=self.anchor_var,
          pre_nms_top_n=prop_op.pre_nms_top_n,
          post_nms_top_n=prop_op.post_nms_top_n,
          nms_thresh=prop_op.nms_thresh,
          min_size=prop_op.min_size,
          eta=prop_op.eta,
      )
      return rpn_rois
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from paddle import fluid
  from paddle.fluid.param_attr import ParamAttr
  from paddle.fluid.initializer import Normal
  from paddle.fluid.regularizer import L2Decay
label_desc: Use image node_id 3 for calling the RPNHead obj's underlying member method code with example usage: obj.get_proposals(body_feats, im_info, mode) and returns: rpn_rois