class_docstr: Apply Rotate Transformation to image (and its corresponding bbox, mask,
  segmentation).
  
  Args:
      level (int | float): The level should be in range (0,_MAX_LEVEL].
      scale (int | float): Isotropic scale factor. Same in
          ``mmcv.imrotate``.
      center (int | float | tuple[float]): Center point (w, h) of the
          rotation in the source image. If None, the center of the
          image will be used. Same in ``mmcv.imrotate``.
      img_fill_val (int | float | tuple): The fill value for image border.
          If float, the same value will be used for all the three
          channels of image. If tuple, the should be 3 elements (e.g.
          equals the number of channels for image).
      seg_ignore_label (int): The fill value used for segmentation map.
          Note this value must equals ``ignore_label`` in ``semantic_head``
          of the corresponding config. Default 255.
      prob (float): The probability for perform transformation and
          should be in range 0 to 1.
      max_rotate_angle (int | float): The maximum angles for rotate
          transformation.
      random_negative_prob (float): The probability that turns the
           offset negative.
class_docstr_tok: ["Apply","Rotate","Transformation","to","image","(","and","its","corresponding","bbox",",","mask",",","segmentation",")",".","Args",":","level","(","int","|","float",")",":","The","level","should","be","in","range","(","0",",","_MAX_LEVEL","]",".","scale","(","int","|","float",")",":","Isotropic","scale","factor",".","Same","in","``","mmcv.imrotate","``",".","center","(","int","|","float","|","tuple","[","float","]",")",":","Center","point","(","w",",","h",")","of","the","rotation","in","the","source","image",".","If","None",",","the","center","of","the","image","will","be","used",".","Same","in","``","mmcv.imrotate","``",".","img_fill_val","(","int","|","float","|","tuple",")",":","The","fill","value","for","image","border",".","If","float",",","the","same","value","will","be","used","for","all","the","three","channels","of","image",".","If","tuple",",","the","should","be","3","elements","(","e.g",".","equals","the","number","of","channels","for","image",")",".","seg_ignore_label","(","int",")",":","The","fill","value","used","for","segmentation","map",".","Note","this","value","must","equals","``","ignore_label","``","in","``","semantic_head","``","of","the","corresponding","config",".","Default","255.","prob","(","float",")",":","The","probability","for","perform","transformation","and","should","be","in","range","0","to","1.","max_rotate_angle","(","int","|","float",")",":","The","maximum","angles","for","rotate","transformation",".","random_negative_prob","(","float",")",":","The","probability","that","turns","the","offset","negative","."]
code: def __init__(
      self,
      level,
      scale=1,
      center=None,
      img_fill_val=128,
      seg_ignore_label=255,
      prob=0.5,
      max_rotate_angle=30,
      random_negative_prob=0.5,
  ):
      assert isinstance(
          level, (int, float)
      ), f"The level must be type int or float. got {type(level)}."
      assert (
          0 <= level <= _MAX_LEVEL
      ), f"The level should be in range (0,{_MAX_LEVEL}]. got {level}."
      assert isinstance(
          scale, (int, float)
      ), f"The scale must be type int or float. got type {type(scale)}."
      if isinstance(center, (int, float)):
          center = (center, center)
      elif isinstance(center, tuple):
          assert len(center) == 2, (
              "center with type tuple must have "
              f"2 elements. got {len(center)} elements."
          )
      else:
          assert center is None, (
              "center must be None or type int, "
              f"float or tuple, got type {type(center)}."
          )
      if isinstance(img_fill_val, (float, int)):
          img_fill_val = tuple([float(img_fill_val)] * 3)
      elif isinstance(img_fill_val, tuple):
          assert len(img_fill_val) == 3, (
              "img_fill_val as tuple must "
              f"have 3 elements. got {len(img_fill_val)}."
          )
          img_fill_val = tuple([float(val) for val in img_fill_val])
      else:
          raise ValueError(
              "img_fill_val must be float or tuple with 3 elements."
          )
      assert np.all([0 <= val <= 255 for val in img_fill_val]), (
          "all elements of img_fill_val should between range [0,255]. "
          f"got {img_fill_val}."
      )
      assert 0 <= prob <= 1.0, (
          "The probability should be in range [0,1]. " "got {prob}."
      )
      assert isinstance(max_rotate_angle, (int, float)), (
          "max_rotate_angle "
          f"should be type int or float. got type {type(max_rotate_angle)}."
      )
      self.level = level
      self.scale = scale
      # Rotation angle in degrees. Positive values mean
      # clockwise rotation.
      self.angle = level_to_value(level, max_rotate_angle)
      self.center = center
      self.img_fill_val = img_fill_val
      self.seg_ignore_label = seg_ignore_label
      self.prob = prob
      self.max_rotate_angle = max_rotate_angle
      self.random_negative_prob = random_negative_prob
  
imports: import copy
  import cv2
  import mmcv
  import numpy
  from ..builder import PIPELINES
  from .compose import Compose
label_desc: Use image node_id 1 to create a new Rotate object from inherited base classes: object with example: obj = Rotate(level, scale, center, img_fill_val, seg_ignore_label, prob, max_rotate_angle, random_negative_prob)