                                                                 do_shuffle=True,
                                                                 is_preview=True)
          logger.debug("Set preview feed. Batchsize: %s", batchsize)
  
      def compile_sample(self, batch_size, samples=None, images=None):
          """ Training samples to display in the viewer """
          num_images = self.config.get("preview_images", 14)
          num_images = min(batch_size, num_images) if batch_size is not None else num_images
          logger.debug("Compiling samples: (side: '%s', samples: %s)", self.side, num_images)
          images = images if images is not None else self.target
 
</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         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)
 </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) </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         self.mask = None
 </s> add         self.masks = None </s> remove     def _set__mask_class(self):
        """ Returns the correct mask class from :mod:`lib`.model.masks` as defined in the
        :attr:`mask_type` parameter. """
        mask_type = self._training_opts.get("mask_type", None)
        if mask_type:
            logger.debug("Mask type: '%s'", mask_type)
            _mask_class = getattr(masks, mask_type)
        else:
            _mask_class = None
        logger.debug("Mask class: %s", _mask_class)
        return _mask_class

 </s> add 
    def compile_sample(self, batch_size, samples=None, images=None, masks=None):
                                                                 do_shuffle=True,
                                                                 is_preview=True)
          logger.debug("Set preview feed. Batchsize: %s", batchsize)
  
    def compile_sample(self, batch_size, samples=None, images=None, masks=None):
          """ Training samples to display in the viewer """
          num_images = self.config.get("preview_images", 14)
          num_images = min(batch_size, num_images) if batch_size is not None else num_images
          logger.debug("Compiling samples: (side: '%s', samples: %s)", self.side, num_images)
          images = images if images is not None else self.target
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