class_docstr: RCNN bbox head
  
  Args:
      head (object): the head module instance, e.g., `ResNetC5`, `TwoFCHead`
      box_coder (object): `BoxCoder` instance
      nms (object): `MultiClassNMS` instance
      num_classes: number of output classes
docstr: Get prediction bounding box in test stage.
  
  Args:
      roi_feat (Variable): RoI feature from RoIExtractor.
      rois (Variable): Output of generate_proposals in rpn head.
      im_info (Variable): A 2-D LoDTensor with shape [B, 3]. B is the
          number of input images, each element consists of im_height,
          im_width, im_scale.
      im_shape (Variable): Actual shape of original image with shape
          [B, 3]. B is the number of images, each element consists of
          original_height, original_width, 1
  
  Returns:
      pred_result(Variable): Prediction result with shape [N, 6]. Each
          row has 6 values: [label, confidence, xmin, ymin, xmax, ymax].
          N is the total number of prediction.
docstr_tok: ["Get","prediction","bounding","box","in","test","stage",".","Args",":","roi_feat","(","Variable",")",":","RoI","feature","from","RoIExtractor",".","rois","(","Variable",")",":","Output","of","generate_proposals","in","rpn","head",".","im_info","(","Variable",")",":","A","2-D","LoDTensor","with","shape","[","B",",","3","]",".","B","is","the","number","of","input","images",",","each","element","consists","of","im_height",",","im_width",",","im_scale",".","im_shape","(","Variable",")",":","Actual","shape","of","original","image","with","shape","[","B",",","3","]",".","B","is","the","number","of","images",",","each","element","consists","of","original_height",",","original_width",",","1","Returns",":","pred_result","(","Variable",")",":","Prediction","result","with","shape","[","N",",","6","]",".","Each","row","has","6","values",":","[","label",",","confidence",",","xmin",",","ymin",",","xmax",",","ymax","]",".","N","is","the","total","number","of","prediction","."]
code: def get_prediction(
      self, roi_feat, rois, im_info, im_shape, return_box_score=False
  ):
      """
      Get prediction bounding box in test stage.
  
      Args:
          roi_feat (Variable): RoI feature from RoIExtractor.
          rois (Variable): Output of generate_proposals in rpn head.
          im_info (Variable): A 2-D LoDTensor with shape [B, 3]. B is the
              number of input images, each element consists of im_height,
              im_width, im_scale.
          im_shape (Variable): Actual shape of original image with shape
              [B, 3]. B is the number of images, each element consists of
              original_height, original_width, 1
  
      Returns:
          pred_result(Variable): Prediction result with shape [N, 6]. Each
              row has 6 values: [label, confidence, xmin, ymin, xmax, ymax].
              N is the total number of prediction.
      """
      cls_score, bbox_pred = self._get_output(roi_feat)
  
      im_scale = fluid.layers.slice(im_info, [1], starts=[2], ends=[3])
      im_scale = fluid.layers.sequence_expand(im_scale, rois)
      boxes = rois / im_scale
      cls_prob = fluid.layers.softmax(cls_score, use_cudnn=False)
      bbox_pred = fluid.layers.reshape(
          bbox_pred, (-1, self.num_classes, 4)
      )
      # self.box_coder
      decoded_box = fluid.layers.box_coder(
          prior_box=boxes,
          target_box=bbox_pred,
          prior_box_var=self.box_coder.prior_box_var,
          code_type=self.box_coder.code_type,
          box_normalized=self.box_coder.box_normalized,
          axis=self.box_coder.axis,
      )
      cliped_box = fluid.layers.box_clip(
          input=decoded_box, im_info=im_shape
      )
      if return_box_score:
          return {"bbox": cliped_box, "score": cls_prob}
      # self.nms
      pred_result = fluid.layers.multiclass_nms(
          bboxes=cliped_box,
          scores=cls_prob,
          score_threshold=self.nms.score_threshold,
          nms_top_k=self.nms.nms_top_k,
          keep_top_k=self.nms.keep_top_k,
          nms_threshold=self.nms.nms_threshold,
          normalized=self.nms.normalized,
          nms_eta=self.nms.nms_eta,
          background_label=self.nms.background_label,
      )
      return pred_result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import OrderedDict
  from paddle import fluid
  from paddle.fluid.param_attr import ParamAttr
  from paddle.fluid.initializer import Normal, Xavier
  from paddle.fluid.regularizer import L2Decay
  from paddle.fluid.initializer import MSRA
label_desc: Use image node_id 5 for calling the BBoxHead obj's underlying member method code with example usage: obj.get_prediction(roi_feat, rois, im_info, im_shape, return_box_score) and returns: pred_result, dict