  
      def initialize(self, training_size):
          """ Initializes the caching of constants for use in various image augmentations.
  
          The training image size is not known prior to loading the images from disk and commencing
          training, so it cannot be set in the :func:`__init__` method. When the first training batch
          is loaded this function should be called to initialize the class and perform various
          calculations based on this input size to cache certain constants for image augmentation
          calculations.
  
          Parameters
          ----------
          training_size: int
               The size of the training images stored on disk that are to be fed into
 
</s> remove     def initialize(self, training_size):
 </s> add     def _get_constants(self) -> AugConstants: </s> remove         Parameters
        ----------
        training_size: int
             The size of the training images stored on disk that are to be fed into
             :class:`ImageAugmentation`. The training images should always be square and of the
             same size. This is the size, in pixels, of the `width` and the `height` of the
             training images.
         """
        logger.debug("Initializing constants. training_size: %s", training_size)
        self._training_size = training_size
        coverage = int(self._training_size * self._coverage_ratio // 2) * 2
 </s> add         # Transform
        tform_shift = (int(self._config.get("shift_range", 5)) / 100) * self._processing_size </s> remove     is_display: bool
        Whether the images being fed through will be used for Preview or Time-lapse. Disables
        the "warp" augmentation for these images.
    input_size: int
        The expected input size for the model. It is assumed that the input to the model is always
        a square image. This is the size, in pixels, of the `width` and the `height` of the input
        to the model.
    output_shapes: list
        A list of tuples defining the output shapes from the model, in the order that the outputs
        are returned. The tuples should be in (`height`, `width`, `channels`) format.
    coverage_ratio: float
        The ratio of the training image to be trained on. Dictates how much of the image will be
        cropped out. E.G: a coverage ratio of 0.625 will result in cropping a 160px box from a
        256px image (:math:`256 * 0.625 = 160`)
 </s> add     processing_size: int
        The largest input or output size of the model. This is the size that images are processed
        at. </s> remove         images: list
            A list of image paths that will be used to compile the final augmented data from.
        batchsize: int
            The batchsize for this iterator. Images will be returned in :class:`numpy.ndarray`
            objects of this size from the iterator.
        side: {'a' or 'b'}
            The side of the model that this iterator is for.
        do_shuffle: bool, optional
            Whether data should be shuffled prior to loading from disk. If true, each time the full
            list of filenames are processed, the data will be reshuffled to make sure they are not
            returned in the same order. Default: ``True``
        is_preview: bool, optional
            Indicates whether this iterator is generating preview images. If ``True`` then certain
            augmentations will not be performed. Default: ``False``
        is_timelapse: bool optional
            Indicates whether this iterator is generating time-lapse images. If ``True``, then
            certain augmentations will not be performed. Default: ``False``
 </s> add         batch: :class:`numpy.ndarray`
            This should be a 4-dimensional array of training images in the format (`batch size`,
            `height`, `width`, `channels`). Targets should be requested after performing image
            transformations but prior to performing warps. The 4th channel should be the mask.
            Any channels above the 4th should be any additional area masks (e.g. eye/mouth) that
            are required. </s> remove         If the configuration options `eye_multiplier` and/or `mouth_multiplier` are greater than 1
        then these masks are applied to the final channels of the batch respectively.
 </s> add     This class is called from :mod:`plugins.train.trainer._base` and launches a background
    iterator that compiles sample preview data for feeding the model's predict function and for
    display.

    Parameters
    ----------
    model: :class:`~plugins.train.model.ModelBase`
        The model that this data generator is feeding
    config: dict
        The configuration `dict` generated from :file:`config.train.ini` containing the trainer
        plugin configuration options.
    side: {'a' or 'b'}
        The side of the model that this iterator is for.
    images: list
        A list of image paths that will be used to compile the final images.
    batch_size: int
        The batch size for this iterator. Images will be returned in :class:`numpy.ndarray`
        objects of this size from the iterator.
    """
    def _create_samples(self,
                        images: np.ndarray,
                        detected_faces: List[DetectedFace]) -> List[np.ndarray]:
        """ Compile the 'sample' images. These are the 100% coverage images which hold the model
        output in the preview window.
        Returns
        -------
        dict
            Cached constants that are used for various augmentations
        """
        logger.debug("Initializing constants.")
  
      def initialize(self, training_size):
          """ Initializes the caching of constants for use in various image augmentations.
  
        Returns
        -------
        dict
            Cached constants that are used for various augmentations
        """
        logger.debug("Initializing constants.")
        Returns
        -------
        dict
            Cached constants that are used for various augmentations
        """
        logger.debug("Initializing constants.")
        Returns
        -------
        dict
            Cached constants that are used for various augmentations
        """
        logger.debug("Initializing constants.")
        Returns
        -------
        dict
            Cached constants that are used for various augmentations
        """
        logger.debug("Initializing constants.")
        Returns
        -------
        dict
            Cached constants that are used for various augmentations
        """
        logger.debug("Initializing constants.")
  
          Parameters
          ----------
          training_size: int
               The size of the training images stored on disk that are to be fed into
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Data Augmentation update (#1263)

- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor 
lib/training/augmentation.py