              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 \
 
</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         * **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** (`numpy.ndarray`, `optional`). Required if :attr:`warp_to_landmarks` is \
        ``True``. The 68 point face landmarks from an alignments file. </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  </s> remove     def _separate_target_mask(batch):
 </s> add     def _separate_target_mask(size_list_of_batches): </s> remove         batch = [tgt.astype("float32") / 255.0 for tgt in batch]
        if all(tgt.shape[-1] == 4 for tgt in batch):
            logger.trace("Batch contains mask")
            sizes = [item.shape[1] for item in batch]
            mask_batch = np.expand_dims(batch[sizes.index(max(sizes))][..., -1], axis=-1)
            batch = [item[..., :3] for item in batch]
            logger.trace("batch shapes: %s, mask_batch shape: %s",
                         [tgt.shape for tgt in batch], mask_batch.shape)
            retval = dict(targets=batch, masks=mask_batch)
 </s> add         targets = [batch[..., :3] for batch in size_list_of_batches]
        if size_list_of_batches[-1].shape[-1] == 4:
            masks = [size_list_of_batches[-1][..., 3:]]
            the format (`batchsize`, `height`, `width`, `1`).
              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`).
            the format (`batchsize`, `height`, `width`, `1`).
  
              * **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 \
keep keep keep keep replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
lib/training_data.py