  from lib.alignments import Alignments
  from lib.faces_detect import DetectedFace
  from lib.training_data import TrainingDataGenerator, stack_images
  from lib.utils import get_folder, get_image_paths
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
 
</s> remove from ._base import TrainerBase as Trainer
 </s> add from ._base import TrainerBase


class Trainer(TrainerBase):
    """ Original is currently identical to Base """
    def __init__(self, *args, **kwargs):  # pylint:disable=useless-super-delegation
        super().__init__(*args, **kwargs)
 </s> remove     def __init__(self, side, images, model, use_mask, batch_size):
        logger.debug("Initializing %s: side: '%s', num_images: %s, batch_size: %s)",
                     self.__class__.__name__, side, len(images), batch_size)
 </s> add     def __init__(self, side, images, model, use_mask, batch_size, config):
        logger.debug("Initializing %s: side: '%s', num_images: %s, batch_size: %s, config: %s)",
                     self.__class__.__name__, side, len(images), batch_size, config) </s> remove         augment_color:      Perform random shifting of LAB colors
 </s> add         augment_color:      Perform random shifting of L*a*b* colors </s> remove         if contrast_random <= 0.5:
            contrast_adjustment = int((contrast_random * 10.0) * (base_contrast / 2))
            grid_size = base_contrast + contrast_adjustment
            logger.trace("Adjusting Contrast. Grid Size: %s", grid_size)

            clahe = cv2.createCLAHE(clipLimit=2.0,  # pylint: disable=no-member
                                    tileGridSize=(grid_size, grid_size))
            for chan in range(3):
                image[:, :, chan] = clahe.apply(image[:, :, chan])
 </s> add         if contrast_random > self.config.get("color_clahe_chance", 50) / 100:
            return image

        base_contrast = image.shape[0] // 128
        grid_base = random() * self.config.get("color_clahe_max_size", 4)
        contrast_adjustment = int(grid_base * (base_contrast / 2))
        grid_size = base_contrast + contrast_adjustment
        logger.trace("Adjusting Contrast. Grid Size: %s", grid_size)

        clahe = cv2.createCLAHE(clipLimit=2.0,  # pylint: disable=no-member
                                tileGridSize=(grid_size, grid_size))
        for chan in range(3):
            image[:, :, chan] = clahe.apply(image[:, :, chan])
from plugins.train._config import Config
  from lib.alignments import Alignments
  from lib.faces_detect import DetectedFace
  from lib.training_data import TrainingDataGenerator, stack_images
  from lib.utils import get_folder, get_image_paths
from plugins.train._config import Config
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
keep keep keep add keep keep keep keep
 Expose Augmentation Options to config 
plugins/train/trainer/_base.py