                  preds[key] = val[self.model.largest_face_index]
          logger.debug("Returning predictions: %s", {key: val.shape for key, val in preds.items()})
          return preds
  
      def to_full_frame(self, side, samples, predictions):
          """ Patch the images into the full frame """
          logger.debug("side: '%s', number of sample arrays: %s, prediction.shapes: %s)",
                       side, len(samples), [pred.shape for pred in predictions])
          full, faces = samples[:2]
          images = [faces] + predictions
          full_size = full.shape[1]
 
</s> remove                 preds[key] = val[self.model.largest_face_index]
 </s> add                 preds[key] = val[self._model.largest_face_index] </s> remove         target_size = int(full_size * self.coverage_ratio)
 </s> add         target_size = int(full_size * self._coverage_ratio) </s> remove         preds["a_a"] = self.model.predictors["a"].predict(feed_a)
        preds["b_a"] = self.model.predictors["b"].predict(feed_a)
        preds["a_b"] = self.model.predictors["a"].predict(feed_b)
        preds["b_b"] = self.model.predictors["b"].predict(feed_b)
 </s> add         preds["a_a"] = self._model.predictors["a"].predict(feed_a)
        preds["b_a"] = self._model.predictors["b"].predict(feed_a)
        preds["a_b"] = self._model.predictors["a"].predict(feed_b)
        preds["b_b"] = self._model.predictors["b"].predict(feed_b) </s> remove             frame = self.frame_overlay(full, target_size, (0, 0, 255))
 </s> add             frame = self._frame_overlay(full, target_size, (0, 0, 255)) </s> remove         """ Timelapse samples """
        batch = next(self.timelapse_feed)
 </s> add         """ Compile the sample images for creating a time-lapse frame.

        Returns
        -------
        list
            The list of samples, targets and masks as :class:`numpy.ndarrays` for creating a
            time-lapse frame
        """
        batch = next(self._timelapse_feed)
    def _to_full_frame(self, side, samples, predictions):
        """ Patch targets and prediction images into images of training image size.

        Parameters
        ----------
        side: {"a" or "b"}
            The side that these samples are for
        samples: list
            List of :class:`numpy.ndarray` of target images and feed images
        predictions: list
            List of :class: `numpy.ndarray` of predictions from the model
        """
                  preds[key] = val[self.model.largest_face_index]
          logger.debug("Returning predictions: %s", {key: val.shape for key, val in preds.items()})
          return preds
  
    def _to_full_frame(self, side, samples, predictions):
        """ Patch targets and prediction images into images of training image size.

        Parameters
        ----------
        side: {"a" or "b"}
            The side that these samples are for
        samples: list
            List of :class:`numpy.ndarray` of target images and feed images
        predictions: list
            List of :class: `numpy.ndarray` of predictions from the model
        """
    def _to_full_frame(self, side, samples, predictions):
        """ Patch targets and prediction images into images of training image size.

        Parameters
        ----------
        side: {"a" or "b"}
            The side that these samples are for
        samples: list
            List of :class:`numpy.ndarray` of target images and feed images
        predictions: list
            List of :class: `numpy.ndarray` of predictions from the model
        """
          logger.debug("side: '%s', number of sample arrays: %s, prediction.shapes: %s)",
                       side, len(samples), [pred.shape for pred in predictions])
          full, faces = samples[:2]
          images = [faces] + predictions
          full_size = full.shape[1]
keep keep keep keep 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. 
plugins/train/trainer/_base.py