      def compile_timelapse_sample(self):
          """ Timelapse samples """
          batch = next(self.timelapse_feed)
          batchsize = len(batch["samples"])
          images = [batch["targets"][self.model.largest_face_index]]
          if self.use_mask:
              images = images + [batch["masks"]]
          sample = self.compile_sample(batchsize, samples=batch["samples"], images=images)
          return sample
  
      def set_timelapse_feed(self, images, batchsize):
          """ Set the timelapse dictionary """
          logger.debug("Setting timelapse feed: (side: '%s', input_images: '%s', batchsize: %s)",
 
</s> remove         retval = [samples[0:num_images]] if samples is not None else [self.samples[0:num_images]]
        if self.use_mask:
            retval.extend(tgt[0:num_images] for tgt in images)
        else:
            retval.extend(images[0:num_images])
 </s> add         masks = masks if masks is not None else self.masks
        samples = samples if samples is not None else self.samples
        retval = [samples[0:num_images], images[0:num_images], masks[0:num_images]] </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 compile_sample(self, batch_size, samples=None, images=None):
 </s> add     def compile_sample(self, batch_size, samples=None, images=None, masks=None): </s> remove         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
 </s> add         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 </s> remove         if self.preview_feed is None:
            self.set_preview_feed()
 </s> add 
        images = batch["targets"][self.model.largest_face_index]
        masks = batch["masks"][0]
        sample = self.compile_sample(batchsize, 
                                     samples=batch["samples"],
                                     images=images,
                                     masks=masks)
      def compile_timelapse_sample(self):
          """ Timelapse samples """
          batch = next(self.timelapse_feed)
          batchsize = len(batch["samples"])
        images = batch["targets"][self.model.largest_face_index]
        masks = batch["masks"][0]
        sample = self.compile_sample(batchsize, 
                                     samples=batch["samples"],
                                     images=images,
                                     masks=masks)
        images = batch["targets"][self.model.largest_face_index]
        masks = batch["masks"][0]
        sample = self.compile_sample(batchsize, 
                                     samples=batch["samples"],
                                     images=images,
                                     masks=masks)
        images = batch["targets"][self.model.largest_face_index]
        masks = batch["masks"][0]
        sample = self.compile_sample(batchsize, 
                                     samples=batch["samples"],
                                     images=images,
                                     masks=masks)
        images = batch["targets"][self.model.largest_face_index]
        masks = batch["masks"][0]
        sample = self.compile_sample(batchsize, 
                                     samples=batch["samples"],
                                     images=images,
                                     masks=masks)
          return sample
  
      def set_timelapse_feed(self, images, batchsize):
          """ Set the timelapse dictionary """
          logger.debug("Setting timelapse feed: (side: '%s', input_images: '%s', batchsize: %s)",
keep keep keep keep 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