          self.training_opts = training_opts
          self.mask_class = self.set_mask_class()
          self.landmarks = self.training_opts.get("landmarks", None)
          self._nearest_landmarks = {}
          self.processing = ImageManipulation(model_input_size,
                                              model_output_shapes,
                                              training_opts.get("coverage_ratio", 0.625),
                                              config)
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def set_mask_class(self):
          """ Set the mask function to use if using mask """
          mask_type = self.training_opts.get("mask_type", None)
          if mask_type:
 
</s> remove         self.batchsize = 0
        self.model_input_size = model_input_size
        self.model_output_shapes = model_output_shapes
        self.training_opts = training_opts
        self.mask_class = self.set_mask_class()
        self.landmarks = self.training_opts.get("landmarks", None)
 </s> add         self._config = config
        self._model_input_size = model_input_size
        self._model_output_shapes = model_output_shapes
        self._training_opts = training_opts
        self._mask_class = self._set__mask_class()
        self._landmarks = self._training_opts.get("landmarks", None) </s> remove     def set_mask_class(self):
        """ Set the mask function to use if using mask """
        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         # Batchsize and processing class are set when this class is called by a batcher
        # from lib.training_data
        self._batchsize = 0
        self._processing = None
        logger.debug("Initialized %s", self.__class__.__name__) </s> remove     def validate_samples(self, data):
        """ Check the total number of images against batchsize and return
            the total number of images """
 </s> add     # << 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. """ </s> remove         self.coverage_ratio = coverage_ratio  # Coverage ratio of full image. Eg: 256 * 0.625 = 160
        self.scale = 5  # Normal random variable scale
        logger.debug("Initialized %s", self.__class__.__name__)
 </s> add         self._coverage_ratio = coverage_ratio
        self._scale = 5  # Normal random variable scale </s> remove         self.input_size = input_size
        self.output_sizes = [shape[1] for shape in output_shapes if shape[2] == 3]
        logger.debug("Output sizes: %s", self.output_sizes)
 </s> add         self._input_size = input_size
        self._output_sizes = [shape[1] for shape in output_shapes if shape[2] == 3]
        logger.debug("Output sizes: %s", self._output_sizes)
          self.training_opts = training_opts
          self.mask_class = self.set_mask_class()
          self.landmarks = self.training_opts.get("landmarks", None)
          self._nearest_landmarks = {}





  
      def set_mask_class(self):
          """ Set the mask function to use if using mask """
          mask_type = self.training_opts.get("mask_type", None)
          if mask_type:
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Optimize Data Augmentation (#881)

* Move image utils to lib.image
* Add .pylintrc file
* Remove some cv2 pylint ignores
* TrainingData: Load images from disk in batches
* TrainingData: get_landmarks to batch
* TrainingData: transform and flip to batches
* TrainingData: Optimize color augmentation
* TrainingData: Optimize target and random_warp
* TrainingData - Convert _get_closest_match for batching
* TrainingData: Warp To Landmarks optimized
* Save models to threadpoolexecutor
* Move stack_images, Rename ImageManipulation. ImageAugmentation Docstrings
* Masks: Set dtype and threshold for lib.masks based on input face
* Docstrings and Documentation 
lib/training_data.py