def METHOD_NAME(self, feats, img_metas, det_bboxes, det_labels):
    """Test for mask head with test time augmentation."""
    if det_bboxes.shape[0] == 0:
        segm_result = [[] for _ in range(self.mask_head.num_classes)]
    else:
        aug_masks = []
        for x, img_meta in zip(feats, img_metas):
            img_shape = img_meta[0]['img_shape']
            scale_factor = img_meta[0]['scale_factor']
            flip = img_meta[0]['flip']
            flip_direction = img_meta[0]['flip_direction']
            _bboxes = bbox_mapping(det_bboxes[:, :4], img_shape,
                                   scale_factor, flip, flip_direction)
            mask_rois = bbox2roi([_bboxes])
            mask_results = self._mask_forward(x, mask_rois)
            # convert to numpy array to save memory
            aug_masks.append(
                mask_results['mask_pred'].sigmoid().cpu().numpy())
        merged_masks = merge_aug_masks(aug_masks, img_metas, self.test_cfg)
        ori_shape = img_metas[0][0]['ori_shape']
        scale_factor = det_bboxes.new_ones(4)
        segm_result = self.mask_head.get_results(
            merged_masks,
            det_bboxes,
            det_labels,
            self.test_cfg,
            ori_shape,
            scale_factor=scale_factor,
            rescale=False)
    return segm_result