  
          return next(batch)[2]
  
      def work(self):
          image = self.trainer.show_sample(self.images_A, self.images_B)
          cv2.imwrite(os.path.join(self.output_dir, str(int(time())) + ".png"), image) 
</s> remove         generator = lib.training_data.TrainingDataGenerator(random_transform_args, 160, zoom)
        batch = generator.minibatchAB(input_images, batch_size, doShuffle=False)
 </s> add         generator = TrainingDataGenerator(random_transform_args, 160, zoom)
        batch = generator.minibatchAB(input_images, batch_size,
                                      doShuffle=False) </s> remove     @staticmethod
    def cv2_read_write(action, filename, image=None):
        """ Read or write an image using cv2 """
        if action == 'read':
            image = cv2.imread(filename)
        if action == 'write':
            cv2.imwrite(filename, image)
        return image

 </s> add  </s> remove                 Utils.cv2_read_write('write', filename, image)
 </s> add                 cv2.imwrite(filename, image) </s> remove def __indent_text_block(text):
    a = text.splitlines()
    if len(a)>1:
        b = a[0] + "\r\n"
        for i in range(1, len(a)-1):
            b = b + "        " + a[i] + "\r\n"
        b = b +  "        " + a[-1]
        return b
    else:
        return text

def Term_Support_Color():
    global OS_Version
    return (OS_Version[0] == "Linux" or OS_Version[0] == "Darwin")

def INFO(text):
    t = "%sINFO   %s " % (color_green, color_default) if Term_Support_Color() else "INFO    "
    print(t + __indent_text_block(text))
 </s> add  </s> remove def WARNING(text):
    t = "%sWARNING%s " % (color_yellow, color_default) if Term_Support_Color() else "WARNING "
    print(t + __indent_text_block(text))

def ERROR(text):
    t = "%sERROR  %s " % (color_red, color_default) if Term_Support_Color() else "ERROR   "
    print(t + __indent_text_block(text))
 </s> add def __indent_text_block(text):
    """ Indent a text block """
    lines = text.splitlines()
    if len(lines) > 1:
        out = lines[0] + "\r\n"
        for i in range(1, len(lines)-1):
            out = out + "        " + lines[i] + "\r\n"
        out = out + "        " + lines[-1]
        return out
    return text


def term_support_color():
    """ Set whether OS Support terminal colour """
    global OS_VERSION
    return OS_VERSION[0] == "Linux" or OS_VERSION[0] == "Darwin"


def out_info(text):
    """ Format INFO Text """
    trm = "INFO    "
    if term_support_color():
        trm = "{}INFO   {} ".format(COLOR_GREEN, COLOR_DEFAULT)
    print(trm + __indent_text_block(text))


def out_warning(text):
    """ Format WARNING Text """
    trm = "WARNING "
    if term_support_color():
        trm = "{}WARNING{} ".format(COLOR_YELLOW, COLOR_DEFAULT)
    print(trm + __indent_text_block(text))


def out_error(text):
    """ Format ERROR Text """
    trm = "ERROR   "
    if term_support_color():
        trm = "{}ERROR  {} ".format(COLOR_RED, COLOR_DEFAULT)
    print(trm + __indent_text_block(text))
  
          return next(batch)[2]
  
      def work(self):


keep keep keep keep replace replace
 Extraction - Speed improvements (#522) (#523)

* Extraction - Speed improvements (#522)

* Initial Plugin restructure

* Detectors to plugins. Detector speed improvements

* Re-implement dlib aligner, remove models, FAN to TF. Parallel processing

* Update manual, update convert, implement parallel/serial switching

* linting + fix cuda check (setup.py). requirements update keras 2.2.4

* Add extract size option. Fix dlib hog init

* GUI: Increase tooltip width

* Update alignment tool to support new DetectedFace

* Add skip existing faces option

* Fix sort tool to new plugin structure

* remove old align plugin

* fix convert -skip faces bug

* Fix convert skipping no faces frames

* Convert - draw onto transparent layer

* Fix blur threshold bug

* fix skip_faces convert bug

* Fix training 
lib/utils.py