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 polygons.
  
  Args:
      aug (imgaug.augmenters.meta.Augmenter): The imgaug augmenter.
      ori_shape (tuple[int, int]): The shape of the original image.
      polys (list[np.ndarray]): The polygons to be augmented.
  
  Returns:
      tuple(list[np.ndarray], list[int]): The augmented polygons, and the
      indices of polygons removed as they are out of the augmented image.
docstr_tok: ["Augment","polygons",".","Args",":","aug","(","imgaug.augmenters.meta.Augmenter",")",":","The","imgaug","augmenter",".","ori_shape","(","tuple","[","int",",","int","]",")",":","The","shape","of","the","original","image",".","polys","(","list","[","np.ndarray","]",")",":","The","polygons","to","be","augmented",".","Returns",":","tuple","(","list","[","np.ndarray","]",",","list","[","int","]",")",":","The","augmented","polygons",",","and","the","indices","of","polygons","removed","as","they","are","out","of","the","augmented","image","."]
code: def _augment_polygons(
      self,
      aug: imgaug.augmenters.meta.Augmenter,
      ori_shape: Tuple[int, int],
      polys: List[np.ndarray],
  ) -> Tuple[List[np.ndarray], List[int]]:
      """Augment polygons.
  
      Args:
          aug (imgaug.augmenters.meta.Augmenter): The imgaug augmenter.
          ori_shape (tuple[int, int]): The shape of the original image.
          polys (list[np.ndarray]): The polygons to be augmented.
  
      Returns:
          tuple(list[np.ndarray], list[int]): The augmented polygons, and the
          indices of polygons removed as they are out of the augmented image.
      """
      imgaug_polys = []
      for poly in polys:
          poly = poly.reshape(-1, 2)
          imgaug_polys.append(imgaug.Polygon(poly))
      imgaug_polys = aug.augment_polygons(
          [imgaug.PolygonsOnImage(imgaug_polys, shape=ori_shape)]
      )[0]
  
      new_polys = []
      removed_poly_inds = []
      for i, poly in enumerate(imgaug_polys.polygons):
          # Sometimes imgaug may produce some invalid polygons with no points
          if not poly.is_valid or poly.is_out_of_image(
              imgaug_polys.shape
          ):
              removed_poly_inds.append(i)
              continue
          new_poly = []
          try:
              poly = poly.clip_out_of_image(imgaug_polys.shape)[0]
          except Exception as e:
              warnings.warn(f"Failed to clip polygon out of image: {e}")
          for point in poly:
              new_poly.append(np.array(point, dtype=np.float32))
          new_poly = np.array(new_poly, dtype=np.float32).flatten()
          # Under some conditions, imgaug can generate "polygon" with only
          # two points, which is not a valid polygon.
          if len(new_poly) <= 4:
              removed_poly_inds.append(i)
              continue
          new_polys.append(new_poly)
  
      return new_polys, removed_poly_inds
  
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 4 for calling the ImgAugWrapper obj's underlying member method code with example usage: obj._augment_polygons(aug, ori_shape, polys) and returns: new_polys,  removed_poly_inds