      def get_next(self, do_preview):
          """ Return the next batch from the generator
              Items should come out as: (warped, target [, mask]) """
          batch = next(self.feed)
          if self.use_mask:
              batch = [[batch["feed"], batch["masks"]], batch["targets"] + [batch["masks"]]]
          else:
              batch = [batch["feed"], batch["targets"]]
          self.generate_preview(do_preview)
          return batch
  
      def generate_preview(self, do_preview):
          """ Generate the preview if a preview iteration """
          if not do_preview:
              self.samples = None
 
</s> remove             Items should come out as: (warped, target [, mask]) """
 </s> add             Items should come out as: (sample, warped, targets, [mask]) """
        logger.debug("Generating targets") </s> remove     def get_next(self, do_preview):
 </s> add     def get_next(self): </s> remove         self.target = [batch["targets"][self.model.largest_face_index]]
        if self.use_mask:
            self.target += [batch["masks"]]
 </s> add         self.target = batch["targets"][self.model.largest_face_index]
        self.masks = batch["masks"][0] </s> remove     def train_one_batch(self, do_preview):
 </s> add     def train_one_batch(self):
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
      def get_next(self, do_preview):
          """ Return the next batch from the generator
              Items should come out as: (warped, target [, mask]) """
          batch = next(self.feed)
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
        targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets
  
      def generate_preview(self, do_preview):
          """ Generate the preview if a preview iteration """
          if not do_preview:
              self.samples = None
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

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