      @property
      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"])
          logger.debug(retval)
          return retval
  
      @property
      def use_mask(self):
 
</s> remove         retval = bool(self.model.training_opts.get("mask_type", None))
 </s> add         retval = (self.model.training_opts.get("replicate_input_mask", False) or
                  self.model.training_opts.get("penalized_mask_loss", True)) </s> remove         return self.config.get("mask_type", None) is not None
 </s> add         return self.config.get("replicate_input_mask", False) </s> remove             retval = [self._detector, self._aligner]
        elif self.passes == 2 and not self.final_pass:
 </s> add             retval = [self._detector, self._aligner, self._masker]
        elif self.passes == 3 and self.phase == 'detect': </s> remove         qname = "extract_align_out" if self.final_pass else "extract_align_in"
 </s> add         qname_dict = dict(detect="extract_align_in",
                          align="extract_mask_in",
                          mask="extract_mask_out")
        qname = "extract_mask_out" if self.final_pass else qname_dict[self.phase] </s> remove         retval = 1 if self._is_parallel else 2
 </s> add         retval = 1 if self._is_parallel else 3
        retval = opts["warp_to_landmarks"]
      @property
      def landmarks_required(self):
          """ Return True if Landmarks are required """
          opts = self.model.training_opts
        retval = opts["warp_to_landmarks"]
          logger.debug(retval)
          return retval
  
      @property
      def use_mask(self):
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/train/trainer/_base.py