docstr: body_feats (list[Tensor]): Multi-level backbone features
  rois (Tensor): Prediction from bbox head with shape [N, 6]
  rois_num (Tensor): The number of prediction for each batch
  scale_factor (Tensor): The scale factor from origin size to input size
docstr_tok: ["body_feats","(","list","[","Tensor","]",")",":","Multi-level","backbone","features","rois","(","Tensor",")",":","Prediction","from","bbox","head","with","shape","[","N",",","6","]","rois_num","(","Tensor",")",":","The","number","of","prediction","for","each","batch","scale_factor","(","Tensor",")",":","The","scale","factor","from","origin","size","to","input","size"]
code: def forward_test(
      self, body_feats, rois, rois_num, scale_factor, feat_func=None
  ):
      """
      body_feats (list[Tensor]): Multi-level backbone features
      rois (Tensor): Prediction from bbox head with shape [N, 6]
      rois_num (Tensor): The number of prediction for each batch
      scale_factor (Tensor): The scale factor from origin size to input size
      """
      if not self.export_onnx and rois.shape[0] == 0:
          mask_out = paddle.full([1, 1, 1], -1)
      else:
          bbox = [rois[:, 2:]]
          labels = rois[:, 0].cast("int32")
          rois_feat = self.roi_extractor(body_feats, bbox, rois_num)
          if self.share_bbox_feat:
              assert feat_func is not None
              rois_feat = feat_func(rois_feat)
  
          mask_feat = self.head(rois_feat)
          mask_logit = self.mask_fcn_logits(mask_feat)
          if self.num_classes == 1:
              mask_out = F.sigmoid(mask_logit)[:, 0, :, :]
          else:
              num_masks = paddle.shape(mask_logit)[0]
              index = paddle.arange(num_masks).cast("int32")
              mask_out = mask_logit[index, labels]
              mask_out_shape = paddle.shape(mask_out)
              mask_out = paddle.reshape(
                  mask_out,
                  [
                      paddle.shape(index),
                      mask_out_shape[-2],
                      mask_out_shape[-1],
                  ],
              )
              mask_out = F.sigmoid(mask_out)
      return mask_out
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import KaimingNormal
  from ppdet.core.workspace import register, create
  from ppdet.modeling.layers import ConvNormLayer
  from .roi_extractor import RoIAlign
  from ..cls_utils import _get_class_default_kwargs
label_desc: Use image node_id 5 for calling the MaskHead obj's underlying member method code with example usage: obj.forward_test(body_feats, rois, rois_num, scale_factor, feat_func) and returns: mask_out