          batcher = BackgroundGenerator(self._minibatch, thread_count=2, args=args)
          return batcher.iterator()
  
      # << INTERNAL METHODS >> #
      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
  
      def _validate_samples(self, data):
          """ Ensures that the total number of images within :attr:`images` is greater or equal to
          the selected :attr:`batchsize`. Raises an exception if this is not the case. """
          length = len(data)
          msg = ("Number of images is lower than batch-size (Note that too few "
 
</s> remove             loss = self.model.predictors[self.side].train_on_batch(*batch)
 </s> add             loss = self.model.predictors[self.side].train_on_batch(x=model_inputs, y=model_targets) </s> remove         config item ``warp_to_landmarks`` is ``True`` or if :attr:`mask_type` is not ``None``. If
        the landmarks for an image cannot be found, then an error is raised. """
 </s> add         config item ``warp_to_landmarks`` is ``True``. If the landmarks for an image cannot be
        found, then an error is raised. """ </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         batch = self.get_next(do_preview)
 </s> add         model_inputs, model_targets = self.get_next() </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]
          batcher = BackgroundGenerator(self._minibatch, thread_count=2, args=args)
          return batcher.iterator()
  
      # << INTERNAL METHODS >> #












      def _validate_samples(self, data):
          """ Ensures that the total number of images within :attr:`images` is greater or equal to
          the selected :attr:`batchsize`. Raises an exception if this is not the case. """
          length = len(data)
          msg = ("Number of images is lower than batch-size (Note that too few "
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
lib/training_data.py