class_docstr: Data augmentation method in `InstaBoost: Boosting Instance
  Segmentation Via Probability Map Guided Copy-Pasting
  <https://arxiv.org/abs/1908.07801>`_.
  
  Refer to https://github.com/GothicAi/Instaboost for implementation details.
  
  
  Required Keys:
  
  - img (np.uint8)
  - instances
  
  Modified Keys:
  
  - img (np.uint8)
  - instances
  
  Args:
      action_candidate (tuple): Action candidates. "normal", "horizontal", \
          "vertical", "skip" are supported. Defaults to ('normal', \
          'horizontal', 'skip').
      action_prob (tuple): Corresponding action probabilities. Should be \
          the same length as action_candidate. Defaults to (1, 0, 0).
      scale (tuple): (min scale, max scale). Defaults to (0.8, 1.2).
      dx (int): The maximum x-axis shift will be (instance width) / dx.
          Defaults to 15.
      dy (int): The maximum y-axis shift will be (instance height) / dy.
          Defaults to 15.
      theta (tuple): (min rotation degree, max rotation degree). \
          Defaults to (-1, 1).
      color_prob (float): Probability of images for color augmentation.
          Defaults to 0.5.
      hflag (bool): Whether to use heatmap guided. Defaults to False.
      aug_ratio (float): Probability of applying this transformation. \
          Defaults to 0.5.
code: def __init__(
      self,
      action_candidate: tuple = ("normal", "horizontal", "skip"),
      action_prob: tuple = (1, 0, 0),
      scale: tuple = (0.8, 1.2),
      dx: int = 15,
      dy: int = 15,
      theta: tuple = (-1, 1),
      color_prob: float = 0.5,
      hflag: bool = False,
      aug_ratio: float = 0.5,
  ) -> None:
      import matplotlib
      import matplotlib.pyplot as plt
  
      default_backend = plt.get_backend()
  
      try:
          import instaboostfast as instaboost
      except ImportError:
          raise ImportError(
              'Please run "pip install instaboostfast" '
              "to install instaboostfast first for instaboost augmentation."
          )
  
      # instaboost will modify the default backend
      # and cause visualization to fail.
      matplotlib.use(default_backend)
  
      self.cfg = instaboost.InstaBoostConfig(
          action_candidate,
          action_prob,
          scale,
          dx,
          dy,
          theta,
          color_prob,
          hflag,
      )
      self.aug_ratio = aug_ratio
  
file_path: mmdetection/mmdet/datasets/transforms/instaboost.py
imports: from typing import Tuple
  import numpy
  from mmcv.transforms import BaseTransform
  from mmdet.registry import TRANSFORMS
label_desc: Use image node_id 1 to create a new InstaBoost object from inherited base classes: BaseTransform with example: obj = InstaBoost(action_candidate, action_prob, scale, dx, dy, theta, color_prob, hflag, aug_ratio)