docstr: Test for mask head with test time augmentation.
code: def aug_test_mask(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
  
file_path: mmdetection/mmdet/models/roi_heads/test_mixins.py
imports: import sys
  import torch
  from mmdet.models.layers import multiclass_nms
  from mmdet.models.test_time_augs import merge_aug_bboxes, merge_aug_masks
  from mmdet.structures.bbox import bbox2roi, bbox_mapping
label_desc: Use image node_id 1 for calling the MaskTestMixin obj's underlying member method code with example usage: obj.aug_test_mask(feats, img_metas, det_bboxes, det_labels) and returns: segm_result