class_docstr: Random padding augmenter.
  
  Parameters
  ----------
  aspect_ratio_range : tuple of floats, default=(0.75, 1.33)
      The padded area of the image must have an aspect ratio = width / height
      within this range.
  area_range : tuple of floats, default=(1.0, 3.0)
      The padded area of the image must be larger than the original area
  max_attempts : int, default=50
      Number of attempts at generating a padded region of the image of the
      specified constraints. After max_attempts failures, return the original image.
  pad_val: float or tuple of float, default=(128, 128, 128)
      pixel value to be filled when padding is enabled.
class_docstr_tok: ["Random","padding","augmenter",".","Parameters","--","--","--","--","--","aspect_ratio_range",":","tuple","of","floats",",","default=","(","0.75",",","1.33",")","The","padded","area","of","the","image","must","have","an","aspect","ratio","=","width","\/","height","within","this","range",".","area_range",":","tuple","of","floats",",","default=","(","1.0",",","3.0",")","The","padded","area","of","the","image","must","be","larger","than","the","original","area","max_attempts",":","int",",","default=50","Number","of","attempts","at","generating","a","padded","region","of","the","image","of","the","specified","constraints",".","After","max_attempts","failures",",","return","the","original","image",".","pad_val",":","float","or","tuple","of","float",",","default=","(","128",",","128",",","128",")","pixel","value","to","be","filled","when","padding","is","enabled","."]
code: def __init__(
      self,
      aspect_ratio_range=(0.75, 1.33),
      area_range=(1.0, 3.0),
      max_attempts=50,
      pad_val=(128, 128, 128),
  ):
      if not isinstance(pad_val, (list, tuple)):
          assert isinstance(pad_val, numeric_types)
          pad_val = pad_val
      if not isinstance(aspect_ratio_range, (list, tuple)):
          assert isinstance(aspect_ratio_range, numeric_types)
          logging.info(
              "Using fixed aspect ratio: %s in DetRandomPadAug",
              str(aspect_ratio_range),
          )
          aspect_ratio_range = (aspect_ratio_range, aspect_ratio_range)
      if not isinstance(area_range, (tuple, list)):
          assert isinstance(area_range, numeric_types)
          logging.info(
              "Using fixed area range: %s in DetRandomPadAug",
              area_range,
          )
          area_range = (area_range, area_range)
      super(DetRandomPadAug, self).__init__(
          aspect_ratio_range=aspect_ratio_range,
          area_range=area_range,
          max_attempts=max_attempts,
          pad_val=pad_val,
      )
      self.pad_val = pad_val
      self.aspect_ratio_range = aspect_ratio_range
      self.area_range = area_range
      self.max_attempts = max_attempts
      self.enabled = False
      if area_range[1] <= 1.0 or area_range[0] > area_range[1]:
          warnings.warn(
              "Skip DetRandomPadAug due to invalid parameters: %s",
              area_range,
          )
      elif (
          aspect_ratio_range[0] <= 0
          or aspect_ratio_range[0] > aspect_ratio_range[1]
      ):
          warnings.warn(
              "Skip DetRandomPadAug due to invalid aspect_ratio_range: %s",
              aspect_ratio_range,
          )
      else:
          self.enabled = True
  
imports: import json
  import logging
  import random
  import warnings
  import numpy
  from ..base import numeric_types
  from ..None import ndarray
  from ..ndarray._internal import _cvcopyMakeBorder
  from ..None import io
  from .image import RandomOrderAug, ColorJitterAug, LightingAug, ColorNormalizeAug
  from .image import ResizeAug, ForceResizeAug, CastAug, HueJitterAug, RandomGrayAug
  from .image import fixed_crop, ImageIter, Augmenter
  from ..util import is_np_array
  from ..None import numpy
label_desc: Use image node_id 1 to create a new DetRandomPadAug object from inherited base classes: DetAugmenter with example: obj = DetRandomPadAug(aspect_ratio_range, area_range, max_attempts, pad_val)