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()
        if self.with_mask:
            mask_loss = self.mask_head(body_feats, rois, rois_num,
                                       self.inputs, bbox_targets, bbox_feat)
            return rpn_loss, bbox_loss, mask_loss
        else:
            return rpn_loss, bbox_loss, {}
    else:
        rois, rois_num, _ = self.rpn_head(body_feats, self.inputs)
        preds, _ = self.bbox_head(body_feats, rois, rois_num, self.inputs)
        refined_rois = self.bbox_head.get_refined_rois()
        im_shape = self.inputs['im_shape']
        scale_factor = self.inputs['scale_factor']
        bbox, bbox_num, nms_keep_idx = self.bbox_post_process(
            preds, (refined_rois, rois_num), im_shape, scale_factor)
        # 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)
        if not self.with_mask:
            return bbox_pred, bbox_num, None
        mask_out = self.mask_head(body_feats, bbox, bbox_num, self.inputs)
        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