class_docstr: Mask R-CNN network, see https://arxiv.org/abs/1703.06870
  
  Args:
      backbone (object): backbone instance
      rpn_head (object): `RPNHead` instance
      bbox_head (object): `BBoxHead` instance
      mask_head (object): `MaskHead` instance
      bbox_post_process (object): `BBoxPostProcess` instance
      mask_post_process (object): `MaskPostProcess` instance
      neck (object): 'FPN' instance
class_docstr_tok: ["Mask","R-CNN","network",",","see","https",":","\/\/arxiv.org\/abs\/1703.06870","Args",":","backbone","(","object",")",":","backbone","instance","rpn_head","(","object",")",":","`","RPNHead","`","instance","bbox_head","(","object",")",":","`","BBoxHead","`","instance","mask_head","(","object",")",":","`","MaskHead","`","instance","bbox_post_process","(","object",")",":","`","BBoxPostProcess","`","instance","mask_post_process","(","object",")",":","`","MaskPostProcess","`","instance","neck","(","object",")",":","'FPN","'","instance"]
code: def _forward(self):
      body_feats = self.backbone(self.inputs)
      if self.neck is not None:
          body_feats = self.neck(body_feats)
  
      if self.training:
          rois, rois_num, rpn_loss = self.rpn_head(
              body_feats, self.inputs
          )
          bbox_loss, bbox_feat = self.bbox_head(
              body_feats, rois, rois_num, self.inputs
          )
          rois, rois_num = self.bbox_head.get_assigned_rois()
          bbox_targets = self.bbox_head.get_assigned_targets()
          # Mask Head needs bbox_feat in Mask RCNN
          mask_loss = self.mask_head(
              body_feats,
              rois,
              rois_num,
              self.inputs,
              bbox_targets,
              bbox_feat,
          )
          return rpn_loss, bbox_loss, mask_loss
      else:
          rois, rois_num, _ = self.rpn_head(body_feats, self.inputs)
          preds, feat_func = self.bbox_head(
              body_feats, rois, rois_num, None
          )
  
          im_shape = self.inputs["im_shape"]
          scale_factor = self.inputs["scale_factor"]
  
          bbox, bbox_num, nms_keep_idx = self.bbox_post_process(
              preds, (rois, rois_num), im_shape, scale_factor
          )
          mask_out = self.mask_head(
              body_feats,
              bbox,
              bbox_num,
              self.inputs,
              feat_func=feat_func,
          )
  
          # rescale the prediction back to origin image
          bbox, bbox_pred, bbox_num = self.bbox_post_process.get_pred(
              bbox, bbox_num, im_shape, scale_factor
          )
          origin_shape = self.bbox_post_process.get_origin_shape()
          mask_pred = self.mask_post_process(
              mask_out, bbox_pred, bbox_num, origin_shape
          )
  
          if self.use_extra_data:
              extra_data = (
                  {}
              )  # record the bbox output before nms, such like scores and nms_keep_idx
              """extra_data:{
                              'scores': predict scores,
                              'nms_keep_idx': bbox index before nms,
                             }
                  """
              extra_data["scores"] = preds[
                  1
              ]  # predict scores (probability)
              # Todo: get logits output
              extra_data[
                  "nms_keep_idx"
              ] = nms_keep_idx  # bbox index before nms
              return bbox_pred, bbox_num, mask_pred, extra_data
          else:
              return bbox_pred, bbox_num, mask_pred
  
file_path: PaddleDetection/ppdet/modeling/architectures/mask_rcnn.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from ppdet.core.workspace import register, create
  from .meta_arch import BaseArch
label_desc: Use image node_id 3 for calling the MaskRCNN obj's underlying member method code with example usage: obj._forward() and returns: rpn_loss,  bbox_loss,  mask_loss, bbox_pred,  bbox_num,  mask_pred,  extra_data, bbox_pred,  bbox_num,  mask_pred