          height = int(64 * self.scaling)
          total_width = width * 3
          logger.debug("height: %s, total_width: %s", height, total_width)
          font = cv2.FONT_HERSHEY_SIMPLEX  # pylint: disable=no-member
          texts = ["Target {}".format(side),
                   "{} > {}".format(side, side),
                   "{} > {}".format(side, other_side)]
          text_sizes = [cv2.getTextSize(texts[idx],  # pylint: disable=no-member
                                        font,
                                        self.scaling,
                                        1)[0]
                        for idx in range(len(texts))]
 
</s> remove                                       self.scaling,
 </s> add                                       self.scaling * 0.8, </s> remove         other_side = other_side.upper()
 </s> add  </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                         self.scaling,
 </s> add                         self.scaling * 0.8, </s> remove     def color_adjust(self, img, augment_color, is_display):
        """ Color adjust RGB image """
        logger.trace("Color adjusting image")
        if not is_display and augment_color:
            logger.trace("Augmenting color")
            face, _ = self.separate_mask(img)
            face = face.astype("uint8")
            face = self.random_clahe(face)
            face = self.random_lab(face)
            img[:, :, :3] = face
        return img.astype('float32') / 255.0

    def random_clahe(self, image):
        """ Randomly perform Contrast Limited Adaptive Histogram Equilization """
        contrast_random = random()
        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])
        return image

    def random_lab(self, image):
        """ Perform random color/lightness adjustment in L*a*b* colorspace """
        amount_l = self.config.get("color_lightness", 30) / 100
        amount_ab = self.config.get("color_ab", 8) / 100

        randoms = [(random() * amount_l * 2) - amount_l,  # L adjust
                   (random() * amount_ab * 2) - amount_ab,  # A adjust
                   (random() * amount_ab * 2) - amount_ab]  # B adjust
 </s> add         logger.debug("Initialized %s", self.__class__.__name__)
        texts = ["{} ({})".format(titles[0], side),
                 "{0} > {0}".format(titles[0]),
                 "{} > {}".format(titles[0], titles[1])]
          height = int(64 * self.scaling)
          total_width = width * 3
          logger.debug("height: %s, total_width: %s", height, total_width)
          font = cv2.FONT_HERSHEY_SIMPLEX  # pylint: disable=no-member
        texts = ["{} ({})".format(titles[0], side),
                 "{0} > {0}".format(titles[0]),
                 "{} > {}".format(titles[0], titles[1])]
        texts = ["{} ({})".format(titles[0], side),
                 "{0} > {0}".format(titles[0]),
                 "{} > {}".format(titles[0], titles[1])]
        texts = ["{} ({})".format(titles[0], side),
                 "{0} > {0}".format(titles[0]),
                 "{} > {}".format(titles[0], titles[1])]
          text_sizes = [cv2.getTextSize(texts[idx],  # pylint: disable=no-member
                                        font,
                                        self.scaling,
                                        1)[0]
                        for idx in range(len(texts))]
keep keep keep keep 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 
plugins/train/trainer/_base.py