                                     self.batchers)
          logger.debug("Initialized %s", self.__class__.__name__)
  
      @property
      def timestamp(self):
          """ Standardised timestamp for loss reporting """
          return time.strftime("%H:%M:%S")
  
      @property
      def landmarks_required(self):
          """ Return True if Landmarks are required """
 
</s> remove     def landmarks_required(self):
        """ Return True if Landmarks are required """
        opts = self.model.training_opts
        retval = bool(opts.get("mask_type", None) or opts["warp_to_landmarks"])
 </s> add     def _landmarks_required(self):
        """ bool: ``True`` if Landmarks are required otherwise ``False ``"""
        retval = self._model.training_opts["warp_to_landmarks"] </s> remove         self.config = get_config(".".join(self.__module__.split(".")[-2:]), configfile=configfile)
        self.batch_size = batch_size
        self.model = model
        self.model.state.add_session_batchsize(batch_size)
        self.images = images
        self.sides = sorted(key for key in self.images.keys())

        self.process_training_opts()
        self.pingpong = PingPong(model, self.sides)

        self.batchers = {side: Batcher(side,
                                       images[side],
                                       self.model,
                                       self.use_mask,
                                       batch_size,
                                       self.config)
                         for side in self.sides}

        self.tensorboard = self.set_tensorboard()
        self.samples = Samples(self.model,
                               self.use_mask,
                               self.model.training_opts["coverage_ratio"],
                               self.model.training_opts["preview_scaling"])
        self.timelapse = Timelapse(self.model,
                                   self.use_mask,
                                   self.model.training_opts["coverage_ratio"],
                                   self.config.get("preview_images", 14),
                                   self.batchers)
 </s> add         self._config = _get_config(".".join(self.__module__.split(".")[-2:]),
                                   configfile=configfile)
        self._model = model
        self._model.state.add_session_batchsize(batch_size)
        self._images = images
        self._sides = sorted(key for key in self._images.keys())

        self._process_training_opts()
        self._pingpong = PingPong(model, self._sides)

        self._batchers = {side: Batcher(side,
                                        images[side],
                                        self._model,
                                        self._use_mask,
                                        batch_size,
                                        self._config)
                          for side in self._sides}

        self._tensorboard = self._set_tensorboard()
        self._samples = Samples(self._model,
                                self._use_mask,
                                self._model.training_opts["coverage_ratio"],
                                self._model.training_opts["preview_scaling"])
        self._timelapse = Timelapse(self._model,
                                    self._use_mask,
                                    self._model.training_opts["coverage_ratio"],
                                    self._config.get("preview_images", 14),
                                    self._batchers) </s> remove     def use_mask(self):
        """ Return True if a mask is requested """
        retval = bool(self.model.training_opts.get("mask_type", None))
 </s> add     def _use_mask(self):
        """ bool: ``True`` if a mask is required otherwise ``False`` """
        retval = (self._model.training_opts["learn_mask"] or
                  self._model.training_opts["penalized_mask_loss"]) </s> remove         """ Set 16 for singleprocess otherwise 32 """
 </s> add         """ Set 16 for single process otherwise 32 """ </s> remove         return self.config.get("mask_type", None) is not None
 </s> add         return self.config.get("learn_mask", False)
    def pingpong(self):
        """ :class:`pingpong`: Ping-pong object for ping-pong memory saving training. """
        return self._pingpong

    @property
    def _timestamp(self):
        """ str: Current time formatted as HOURS:MINUTES:SECONDS """
                                     self.batchers)
          logger.debug("Initialized %s", self.__class__.__name__)
  
      @property
    def pingpong(self):
        """ :class:`pingpong`: Ping-pong object for ping-pong memory saving training. """
        return self._pingpong

    @property
    def _timestamp(self):
        """ str: Current time formatted as HOURS:MINUTES:SECONDS """
    def pingpong(self):
        """ :class:`pingpong`: Ping-pong object for ping-pong memory saving training. """
        return self._pingpong

    @property
    def _timestamp(self):
        """ str: Current time formatted as HOURS:MINUTES:SECONDS """
          return time.strftime("%H:%M:%S")
  
      @property
      def landmarks_required(self):
          """ Return True if Landmarks are required """
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