class_docstr: Abstract generator class.
      
docstr: Initialize Generator object.
  
  Args
      transform_generator    : A generator used to randomly transform images and annotations.
      batch_size             : The size of the batches to generate.
      group_method           : Determines how images are grouped together (defaults to 'ratio', one of ('none', 'random', 'ratio')).
      shuffle_groups         : If True, shuffles the groups each epoch.
      image_min_side         : After resizing the minimum side of an image is equal to image_min_side.
      image_max_side         : If after resizing the maximum side is larger than image_max_side, scales down further so that the max side is equal to image_max_side.
      no_resize              : If True, no image/annotation resizing is performed.
      transform_parameters   : The transform parameters used for data augmentation.
      compute_anchor_targets : Function handler for computing the targets of anchors for an image and its annotations.
      compute_shapes         : Function handler for computing the shapes of the pyramid for a given input.
      preprocess_image       : Function handler for preprocessing an image (scaling / normalizing) for passing through a network.
code: def __init__(
      self,
      transform_generator=None,
      visual_effect_generator=None,
      batch_size=1,
      group_method="ratio",  # one of 'none', 'random', 'ratio'
      shuffle_groups=True,
      image_min_side=800,
      image_max_side=1333,
      no_resize=False,
      transform_parameters=None,
      compute_anchor_targets=anchor_targets_bbox,
      compute_shapes=guess_shapes,
      preprocess_image=preprocess_image,
      config=None,
  ):
      """Initialize Generator object.
  
      Args
          transform_generator    : A generator used to randomly transform images and annotations.
          batch_size             : The size of the batches to generate.
          group_method           : Determines how images are grouped together (defaults to 'ratio', one of ('none', 'random', 'ratio')).
          shuffle_groups         : If True, shuffles the groups each epoch.
          image_min_side         : After resizing the minimum side of an image is equal to image_min_side.
          image_max_side         : If after resizing the maximum side is larger than image_max_side, scales down further so that the max side is equal to image_max_side.
          no_resize              : If True, no image/annotation resizing is performed.
          transform_parameters   : The transform parameters used for data augmentation.
          compute_anchor_targets : Function handler for computing the targets of anchors for an image and its annotations.
          compute_shapes         : Function handler for computing the shapes of the pyramid for a given input.
          preprocess_image       : Function handler for preprocessing an image (scaling / normalizing) for passing through a network.
      """
      self.transform_generator = transform_generator
      self.visual_effect_generator = visual_effect_generator
      self.batch_size = int(batch_size)
      self.group_method = group_method
      self.shuffle_groups = shuffle_groups
      self.image_min_side = image_min_side
      self.image_max_side = image_max_side
      self.no_resize = no_resize
      self.transform_parameters = (
          transform_parameters or TransformParameters()
      )
      self.compute_anchor_targets = compute_anchor_targets
      self.compute_shapes = compute_shapes
      self.preprocess_image = preprocess_image
      self.config = config
  
      # Define groups
      self.group_images()
  
      # Shuffle when initializing
      if self.shuffle_groups:
          self.on_epoch_end()
  
imports: import numpy
  import random
  import warnings
  from tensorflow import keras
  from ..utils.anchors import anchor_targets_bbox, anchors_for_shape, guess_shapes
  from ..utils.config import parse_anchor_parameters, parse_pyramid_levels
  from ..utils.image import TransformParameters, adjust_transform_for_image, apply_transform, preprocess_image, resize_image
  from ..utils.transform import transform_aabb
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: keras.utils with example: obj = Generator(transform_generator, visual_effect_generator, batch_size, group_method, shuffle_groups, image_min_side, image_max_side, no_resize, transform_parameters, compute_anchor_targets, compute_shapes, preprocess_image, config)