              Keras model, they will need to be added to this list in \
              :mod:`plugins.train.trainer._base` from the ``masks`` key.
  
              * **masks** (`numpy.ndarray`) - A 4-dimensional array containing the target masks in \
              the format (`batchsize`, `height`, `width`, `1`). **NB:** This item will only exist \
              in the ``dict`` if the :attr:`mask_type` is not ``None``
  
              * **samples** (`numpy.ndarray`) - A 4-dimensional array containg the samples for \
              feeding to the model's predict function for generating preview and timelapse samples. \
              The array will be in the format (`batchsize`, `height`, `width`, `channels`). **NB:** \
              This item will only exist in the ``dict`` if :attr:`is_preview` or \
              :attr:`is_timelapse` is ``True``
          """
          logger.debug("Queue batches: (image_count: %s, batchsize: %s, side: '%s', do_shuffle: %s, "
                       "is_preview, %s, is_timelapse: %s)", len(images), batchsize, side, do_shuffle,
                       is_preview, is_timelapse)
          self._batchsize = batchsize
 
</s> remove             the format (`batchsize`, `height`, `width`, `1`). **NB:** This item will only exist \
            in the ``dict`` if a batch of 4 channel images has been passed in :attr:`batch`
 </s> add             the format (`batchsize`, `height`, `width`, `1`). </s> remove         Dictates how much of the image will be cropped out. Eg: a coverage ratio of 0.625 \
 </s> add         Dictates how much of the image will be cropped out. E.G: a coverage ratio of 0.625 \ </s> remove         * **landmarks** (`numpy.ndarray`, `optional`). Required if using a :attr:`mask_type` is \
        not ``None`` or :attr:`warp_to_landmarks` is ``True``. The 68 point face landmarks from \
        an alignments file.
 </s> add         * **landmarks** (`dict`, `optional`). Required if :attr:`warp_to_landmarks` is \
        ``True``. Returning dictionary has a key of **side** (`str`) the value of which is a \
        `dict` of {**filename** (`str`): **68 point landmarks** (`numpy.ndarray`)}.

        * **masks** (`dict`, `optional`). Required if :attr:`penalized_mask_loss` or \
        :attr:`learn_mask` is ``True``. Returning dictionary has a key of **side** (`str`) the \
        value of which is a `dict` of {**filename** (`str`): :class:`lib.faces_detect.Mask`}. </s> remove         * **mask_type** (`str`) - The mask type to be used (as defined in \
        :mod:`lib.model.masks`). If not ``None`` then the additional key ``landmarks`` must be \
        provided.

 </s> add 
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
              Keras model, they will need to be added to this list in \
              :mod:`plugins.train.trainer._base` from the ``masks`` key.
  
              * **masks** (`numpy.ndarray`) - A 4-dimensional array containing the target masks in \
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
            the format (`batchsize`, `height`, `width`, `1`).

            * **samples** (`numpy.ndarray`) - A 4-dimensional array containing the samples for \
            feeding to the model's predict function for generating preview and time-lapse \
            samples. The array will be in the format (`batchsize`, `height`, `width`, \
            `channels`). **NB:** This item will only exist in the ``dict`` if :attr:`is_preview` \
            or :attr:`is_timelapse` is ``True``
          """
          logger.debug("Queue batches: (image_count: %s, batchsize: %s, side: '%s', do_shuffle: %s, "
                       "is_preview, %s, is_timelapse: %s)", len(images), batchsize, side, do_shuffle,
                       is_preview, is_timelapse)
          self._batchsize = batchsize
keep keep keep keep replace replace replace replace replace replace replace 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