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 = mask_logit.shape[0]
                index = paddle.arange(num_masks).cast('int32')
                mask_out = mask_logit[index, labels]
                mask_out_shape = mask_out.shape
                mask_out = paddle.reshape(mask_out, 
                    index.shape + [mask_out_shape[-2]] + [mask_out_shape[-1]])
                mask_out = F.sigmoid(mask_out)
        return mask_out

        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
        
ppdet/modeling/heads/mask_head.py