          figures = dict()
          headers = dict()
          for side, samples in self.images.items():
              faces = samples[1]
              if self.model.input_shape[0] / faces.shape[1] != 1.0:
                  feeds[side] = self.resize_sample(side, faces, self.model.input_shape[0])
                  feeds[side] = feeds[side].reshape((-1, ) + self.model.input_shape)
              else:
                  feeds[side] = faces
              if self.use_mask:
                  mask = samples[-1]
                  feeds[side] = [feeds[side], mask]
 
</s> remove             if self.use_mask:
 </s> add             if self._use_mask: </s> remove         preds = self.get_predictions(feeds["a"], feeds["b"])
 </s> add         preds = self._get_predictions(feeds["a"], feeds["b"]) </s> remove         target_size = int(full_size * self.coverage_ratio)
 </s> add         target_size = int(full_size * self._coverage_ratio) </s> remove             headers = self.duplicate_headers(headers, side_cols)
 </s> add             headers = self._duplicate_headers(headers, side_cols) </s> remove             images = [self.overlay_foreground(frame, image) for image in images]
        if self.scaling != 1.0:
            new_size = int(full_size * self.scaling)
            images = [self.resize_sample(side, image, new_size) for image in images]
 </s> add             images = [self._overlay_foreground(frame, image) for image in images]
        if self._scaling != 1.0:
            new_size = int(full_size * self._scaling)
            images = [self._resize_sample(side, image, new_size) for image in images]
            if self._model.input_shape[0] / faces.shape[1] != 1.0:
                feeds[side] = self._resize_sample(side, faces, self._model.input_shape[0])
                feeds[side] = feeds[side].reshape((-1, ) + self._model.input_shape)
          figures = dict()
          headers = dict()
          for side, samples in self.images.items():
              faces = samples[1]
            if self._model.input_shape[0] / faces.shape[1] != 1.0:
                feeds[side] = self._resize_sample(side, faces, self._model.input_shape[0])
                feeds[side] = feeds[side].reshape((-1, ) + self._model.input_shape)
            if self._model.input_shape[0] / faces.shape[1] != 1.0:
                feeds[side] = self._resize_sample(side, faces, self._model.input_shape[0])
                feeds[side] = feeds[side].reshape((-1, ) + self._model.input_shape)
            if self._model.input_shape[0] / faces.shape[1] != 1.0:
                feeds[side] = self._resize_sample(side, faces, self._model.input_shape[0])
                feeds[side] = feeds[side].reshape((-1, ) + self._model.input_shape)
              else:
                  feeds[side] = faces
              if self.use_mask:
                  mask = samples[-1]
                  feeds[side] = [feeds[side], mask]
keep keep keep keep 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. 
plugins/train/trainer/_base.py