          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 thay 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
 
</s> remove             Indicates whether this iterator is generating Timelapse images. If ``True``, then
 </s> add             Indicates whether this iterator is generating time-lapse images. If ``True``, then </s> remove     def compile_sample(self, batch_size, samples=None, images=None):
        """ Training samples to display in the viewer """
        num_images = self.config.get("preview_images", 14)
 </s> add     def compile_sample(self, batch_size, samples=None, images=None, masks=None):
        """ Compile the preview samples for display.

        Parameters
        ----------
        batch_size: int
            The requested batch size for each training iterations
        samples: :class:`numpy.ndarray`, optional
            The sample images that should be used for creating the preview. If ``None`` then the
            samples will be generated from the internal random image generator.
            Default: ``None``
        images:  :class:`numpy.ndarray`, optional
            The target images that should be used for creating the preview. If ``None`` then the
            targets will be generated from the internal random image generator.
            Default: ``None``
        masks:  :class:`numpy.ndarray`, optional
            The masks that should be used for creating the preview. If ``None`` then the
            masks will be generated from the internal random image generator.
            Default: ``None``

        Returns
        -------
        list
            The list of samples, targets and masks as :class:`numpy.ndarrays` for creating a
            preview image
         """
        num_images = self._config.get("preview_images", 14) </s> remove         training, preview and timelapses.
 </s> add         training, preview and time-lapses. </s> remove     """ Display samples for preview and timelapse """
 </s> add     """ Compile samples for display for preview and time-lapse

    Parameters
    ----------
    model: plugin from :mod:`plugins.train.model`
        The selected model that will be running this trainer
    use_mask: bool
        ``True`` if a mask should be displayed otherwise ``False``
    coverage_ratio: float
        Ratio of face to be cropped out of the training image.
    scaling: float, optional
        The amount to scale the final preview image by. Default: `1.0`

    Attributes
    ----------
    images: dict
        The :class:`numpy.ndarray` training images for generating previews on each side. The
        dictionary should contain 2 keys ("a" and "b") with the values being the training images
        for generating samples corresponding to each side.
    """ </s> remove     """ Batch images from a single side """
 </s> add     """ Handles the processing of a Batch for a single side.

    Parameters
    ----------
    side: {"a" or "b"}
        The side that this :class:`Batcher` belongs to
    images: list
        The list of full paths to the training images for this :class:`Batcher`
    model: plugin from :mod:`plugins.train.model`
        The selected model that will be running this trainer
    use_mask: bool
        ``True`` if a mask is required for training otherwise ``False``
    batch_size: int
        The size of the batch to be processed at each iteration
    config: :class:`lib.config.FaceswapConfig`
        The configuration for this trainer
    """
            list of filenames are processed, the data will be reshuffled to make sure they are not
          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
keep keep keep keep replace keep keep keep keep keep
 Smart Masks - Training Implementation (#914)

* Smart Masks - Training

- Reinstate smart mask training code
- Reinstate mask_type back to model.config
- change 'replicate_input_mask to 'learn_mask'
- Add learn mask option
- Add mask loading from alignments to plugins.train.trainer
- Add mask_blur and mask threshold options
- _base.py - Pass mask options through training_opts dict
- plugins.train.model - check for mask_type not None for learn_mask and penalized_mask_loss
- Limit alignments loading to just those faces that appear in the training folder
- Raise error if not all training images have an alignment, and alignment file is required
- lib.training_data - Mask generation code
- lib.faces_detect - cv2 dimension stripping bugfix
- Remove cv2 linting code

* Update mask helptext in cli.py

* Fix Warp to Landmarks
Remove SHA1 hashing from training data

* Update mask training config

* Capture missing masks at training init

* lib.image.read_image_batch - Return filenames with batch for ordering

* scripts.train - Documentation

* plugins.train.trainer - documentation

* Ensure backward compatibility.
Fix convert for new predicted masks

* Update removed masks to components for legacy models. 
lib/training_data.py