class_docstr: A wrapper around imgaug https://github.com/aleju/imgaug.
  
  Find available augmenters at
  https://imgaug.readthedocs.io/en/latest/source/overview_of_augmenters.html.
  
  Required Keys:
  
  - img
  - gt_polygons (optional for text recognition)
  - gt_bboxes (optional for text recognition)
  - gt_bboxes_labels (optional for text recognition)
  - gt_ignored (optional for text recognition)
  - gt_texts (optional)
  
  Modified Keys:
  
  - img
  - gt_polygons (optional for text recognition)
  - gt_bboxes (optional for text recognition)
  - gt_bboxes_labels (optional for text recognition)
  - gt_ignored (optional for text recognition)
  - img_shape (optional)
  - gt_texts (optional)
  
  Args:
      args (list[list or dict]], optional): The argumentation list. For
          details, please refer to imgaug document. Take
          args=[['Fliplr', 0.5], dict(cls='Affine', rotate=[-10, 10]),
          ['Resize', [0.5, 3.0]]] as an example. The args horizontally flip
          images with probability 0.5, followed by random rotation with
          angles in range [-10, 10], and resize with an independent scale in
          range [0.5, 3.0] for each side of images. Defaults to None.
      fix_poly_trans (dict): The transform configuration to fix invalid
          polygons. Set it to None if no fixing is needed.
          Defaults to dict(type='FixInvalidPolygon').
docstr: Augment annotations following the pre-defined augmentation sequence.
  
  Args:
      aug (imgaug.augmenters.meta.Augmenter): The imgaug augmenter.
      ori_shape (tuple[int, int]): The ori_shape of the original image.
      results (dict): Result dict containing annotations to transform.
  
  Returns:
      bool: Whether the transformation has been successfully applied. If
      the transform results in empty polygon/bbox annotations, return
      False.
docstr_tok: ["Augment","annotations","following","the","pre-defined","augmentation","sequence",".","Args",":","aug","(","imgaug.augmenters.meta.Augmenter",")",":","The","imgaug","augmenter",".","ori_shape","(","tuple","[","int",",","int","]",")",":","The","ori_shape","of","the","original","image",".","results","(","dict",")",":","Result","dict","containing","annotations","to","transform",".","Returns",":","bool",":","Whether","the","transformation","has","been","successfully","applied",".","If","the","transform","results","in","empty","polygon\/bbox","annotations",",","return","False","."]
code: def _augment_annotations(
      self,
      aug: imgaug.augmenters.meta.Augmenter,
      ori_shape: Tuple[int, int],
      results: Dict,
  ) -> Dict:
      """Augment annotations following the pre-defined augmentation sequence.
  
      Args:
          aug (imgaug.augmenters.meta.Augmenter): The imgaug augmenter.
          ori_shape (tuple[int, int]): The ori_shape of the original image.
          results (dict): Result dict containing annotations to transform.
  
      Returns:
          bool: Whether the transformation has been successfully applied. If
          the transform results in empty polygon/bbox annotations, return
          False.
      """
      # Assume co-existence of `gt_polygons`, `gt_bboxes` and `gt_ignored`
      # for text detection
      if "gt_polygons" in results:
          # augment polygons
          (
              transformed_polygons,
              removed_poly_inds,
          ) = self._augment_polygons(
              aug, ori_shape, results["gt_polygons"]
          )
          if len(transformed_polygons) == 0:
              return False
          results["gt_polygons"] = transformed_polygons
  
          # remove instances that are no longer inside the augmented image
          results["gt_bboxes_labels"] = np.delete(
              results["gt_bboxes_labels"], removed_poly_inds, axis=0
          )
          results["gt_ignored"] = np.delete(
              results["gt_ignored"], removed_poly_inds, axis=0
          )
          # TODO: deal with gt_texts corresponding to clipped polygons
          if "gt_texts" in results:
              results["gt_texts"] = [
                  text
                  for i, text in enumerate(results["gt_texts"])
                  if i not in removed_poly_inds
              ]
  
          # Generate new bboxes
          bboxes = [poly2bbox(poly) for poly in transformed_polygons]
          results["gt_bboxes"] = np.zeros((0, 4), dtype=np.float32)
          if len(bboxes) > 0:
              results["gt_bboxes"] = np.stack(bboxes)
  
      return True
  
imports: import warnings
  from typing import Any, Dict, List, Optional, Tuple, Union
  import imgaug
  import imgaug.augmenters
  import numpy
  import torchvision.transforms
  from mmcv.transforms import Compose
  from mmcv.transforms.base import BaseTransform
  from PIL import Image
  from mmocr.registry import TRANSFORMS
  from mmocr.utils import poly2bbox
label_desc: Use image node_id 3 for calling the ImgAugWrapper obj's underlying member method code with example usage: obj._augment_annotations(aug, ori_shape, results) and returns: True, False