              snapshot_interval=self.args.snapshot_interval,
              no_logs=self.args.no_logs,
              warp_to_landmarks=self.args.warp_to_landmarks,
              augment_color=augment_color,
              no_flip=self.args.no_flip,
              training_image_size=self.image_size,
              alignments_paths=self.alignments_paths,
              preview_scale=self.args.preview_scale,
              pingpong=self.args.pingpong,
              memory_saving_gradients=self.args.memory_saving_gradients,
              optimizer_savings=self.args.optimizer_savings,
              predict=False)
          logger.debug("Loaded Model")
          return model
  
      @property
 
</s> remove             snapshot_interval=self.args.snapshot_interval,
            no_logs=self.args.no_logs,
            warp_to_landmarks=self.args.warp_to_landmarks,
 </s> add             snapshot_interval=self._args.snapshot_interval,
            no_logs=self._args.no_logs,
            warp_to_landmarks=self._args.warp_to_landmarks, </s> remove             gpus=self.args.gpus,
 </s> add             gpus=self._args.gpus, </s> remove     @property
    def image_size(self):
        """ Get the training set image size for storing in model data """
        image = read_image(self.images["a"][0], raise_error=True)
        size = image.shape[0]
        logger.debug("Training image size: %s", size)
        return size
 </s> add     def _load_trainer(self, model):
        """ Load the trainer requested for training. </s> remove         model_dir = get_folder(self.args.model_dir)
        configfile = self.args.configfile if hasattr(self.args, "configfile") else None
        augment_color = not self.args.no_augment_color
 </s> add         model_dir = get_folder(self._args.model_dir)
        configfile = self._args.configfile if hasattr(self._args, "configfile") else None
        augment_color = not self._args.no_augment_color </s> remove     def load_model(self):
        """ Load the model requested for training """
 </s> add     def _load_model(self):
        """ Load the model requested for training.

        Returns
        -------
        :file:`plugins.train.model` plugin
            The requested model plugin
        """
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
              snapshot_interval=self.args.snapshot_interval,
              no_logs=self.args.no_logs,
              warp_to_landmarks=self.args.warp_to_landmarks,
              augment_color=augment_color,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
            no_flip=self._args.no_flip,
            training_image_size=self._image_size,
            alignments_paths=self._alignments_paths,
            preview_scale=self._args.preview_scale,
            pingpong=self._args.pingpong,
            memory_saving_gradients=self._args.memory_saving_gradients,
            optimizer_savings=self._args.optimizer_savings,
              predict=False)
          logger.debug("Loaded Model")
          return model
  
      @property
keep keep keep keep 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. 
scripts/train.py