          retval = np.array(new_images)
          logger.debug("Overlayed foreground. Shape: %s", retval.shape)
          return retval
  
      def get_headers(self, side, other_side, width):
          """ Set headers for images """
          logger.debug("side: '%s', other_side: '%s', width: %s",
                       side, other_side, width)
          side = side.upper()
          other_side = other_side.upper()
 
</s> remove         logger.debug("side: '%s', other_side: '%s', width: %s",
                     side, other_side, width)
 </s> add         logger.debug("side: '%s', width: %s",
                     side, width)
        titles = ("Original", "Swap") if side == "a" else ("Swap", "Original") </s> remove         other_side = other_side.upper()
 </s> add  </s> remove             predictions = [preds["{}_{}".format(side, side)],
 </s> add             predictions = [preds["{0}_{0}".format(side)], </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         self.batchsize = batchsize
        is_display = is_preview or is_timelapse
        args = (images, side, is_display, do_shuffle, batchsize)
        batcher = BackgroundGenerator(self.minibatch, thread_count=2, args=args)
 </s> add         self._batchsize = batchsize
        self._processing = ImageAugmentation(batchsize,
                                             is_preview or is_timelapse,
                                             self._model_input_size,
                                             self._model_output_shapes,
                                             self._training_opts.get("coverage_ratio", 0.625),
                                             self._config)
        args = (images, side, do_shuffle, batchsize)
        batcher = BackgroundGenerator(self._minibatch, thread_count=2, args=args)
    def get_headers(self, side, width):
          retval = np.array(new_images)
          logger.debug("Overlayed foreground. Shape: %s", retval.shape)
          return retval
  
    def get_headers(self, side, width):
          """ Set headers for images """
          logger.debug("side: '%s', other_side: '%s', width: %s",
                       side, other_side, width)
          side = side.upper()
          other_side = other_side.upper()
keep keep keep keep 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 
plugins/train/trainer/_base.py