class_docstr: Test-time augmentation with multiple scales and flipping.
  
  An example configuration is as followed:
  
  .. code-block::
  
      img_scale=[(1333, 400), (1333, 800)],
      flip=True,
      transforms=[
          dict(type='Resize', keep_ratio=True),
          dict(type='RandomFlip'),
          dict(type='Normalize', **img_norm_cfg),
          dict(type='Pad', size_divisor=32),
          dict(type='ImageToTensor', keys=['img']),
          dict(type='Collect', keys=['img']),
      ]
  
  After MultiScaleFLipAug with above configuration, the results are wrapped
  into lists of the same length as followed:
  
  .. code-block::
  
      dict(
          img=[...],
          img_shape=[...],
          scale=[(1333, 400), (1333, 400), (1333, 800), (1333, 800)]
          flip=[False, True, False, True]
          ...
      )
  
  Args:
      transforms (list[dict]): Transforms to apply in each augmentation.
      img_scale (tuple | list[tuple] | None): Images scales for resizing.
      scale_factor (float | list[float] | None): Scale factors for resizing.
      flip (bool): Whether apply flip augmentation. Default: False.
      flip_direction (str | list[str]): Flip augmentation directions,
          options are "horizontal" and "vertical". If flip_direction is list,
          multiple flip augmentations will be applied.
          It has no effect when flip == False. Default: "horizontal".
code: def __init__(
      self,
      transforms,
      img_scale=None,
      scale_factor=None,
      flip=False,
      flip_direction="horizontal",
  ):
      self.transforms = Compose(transforms)
      assert (img_scale is None) ^ (
          scale_factor is None
      ), "Must have but only one variable can be setted"
      if img_scale is not None:
          self.img_scale = (
              img_scale if isinstance(img_scale, list) else [img_scale]
          )
          self.scale_key = "scale"
          assert mmcv.is_list_of(self.img_scale, tuple)
      else:
          self.img_scale = (
              scale_factor
              if isinstance(scale_factor, list)
              else [scale_factor]
          )
          self.scale_key = "scale_factor"
  
      self.flip = flip
      self.flip_direction = (
          flip_direction
          if isinstance(flip_direction, list)
          else [flip_direction]
      )
      assert mmcv.is_list_of(self.flip_direction, str)
      if not self.flip and self.flip_direction != ["horizontal"]:
          warnings.warn(
              "flip_direction has no effect when flip is set to False"
          )
      if self.flip and not any(
          [t["type"] == "RandomFlip" for t in transforms]
      ):
          warnings.warn(
              "flip has no effect when RandomFlip is not in transforms"
          )
  
file_path: insightface/detection/scrfd/mmdet/datasets/pipelines/test_time_aug.py
imports: import warnings
  import mmcv
  from ..builder import PIPELINES
  from .compose import Compose
label_desc: Use image node_id 1 to create a new MultiScaleFlipAug object from inherited base classes: object with example: obj = MultiScaleFlipAug(transforms, img_scale, scale_factor, flip, flip_direction)