def METHOD_NAME(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 = 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)
        return bbox_pred, bbox_num, mask_pred