          self.lock = threading.Lock()
  
          # this is so that you can enter case insensitive values for trainer
          trainer_name = self.args.trainer
          self.trainer_name = "LowMem" if trainer_name.lower() == "lowmem" else trainer_name
          self.timelapse = None
  
      def process(self):
          """ Call the training process object """
          print("Training data directory: {}".format(self.args.model_dir))
 
</s> remove         if (hasattr(self.args, 'multiprocess')
                and self.args.multiprocess
                and GPUStats().device_count == 0):
            # TODO Checking that there is no available GPU is not
            # necessarily an indicator of whether the user is actually
            # using the CPU. Maybe look to implement further checks on
            # dlib/tensorflow compilations
            self.extract_multi_process()
        else:
            self.extract_single_process()
 </s> add     def threaded_io(self, task, io_args=None):
        """ Load images in a background thread """
        io_args = tuple() if io_args is None else (io_args, )
        if task == "load":
            func = self.load_images
        elif task == "save":
            func = self.save_faces
        elif task == "reload":
            func = self.reload_images
        io_thread = MultiThread(thread_count=1)
        io_thread.in_thread(func, *io_args)
        return io_thread </s> remove     def CreateTimelapse(test, input_dir_A, input_dir_B, output_dir, trainer):
        #self.input_dir = input
        #self.output_dir = output
        #self.trainer = trainer

        if input_dir_A is None and input_dir_B is None and output_dir is None:
 </s> add     def create_timelapse(cls, input_dir_a, input_dir_b, output_dir, trainer):
        """ Create the time lapse """
        if input_dir_a is None and input_dir_b is None and output_dir is None: </s> remove class Faces():
    """ Holds the faces """
    def __init__(self, arguments):
        self.args = arguments
        self.extractor = self.load_extractor()
        self.mtcnn_kwargs = self.get_mtcnn_kwargs()
        self.filter = self.load_face_filter()
        self.align_eyes = self.args.align_eyes if hasattr(
            self.args, 'align_eyes') else False
        self.output_dir = get_folder(self.args.output_dir)
 </s> add         if skip_faces:
            # Remove items from algnments that have no faces so they will
            # be re-detected
            del_keys = [key for key, val in data.items() if not val]
            for key in del_keys:
                if key in data:
                    del data[key] </s> remove class DetectedFace():
    """ Detected face and landmark information """
    def __init__(self):
        self.image = None
        self.x = None
        self.w = None
        self.y = None
        self.h = None
        self.landmarksXY = None

    def alignment_to_face(self, image, alignment):
        """ Convert a face alignment to detected face object """
        self.image = image
        self.x = alignment["x"]
        self.w = alignment["w"]
        self.y = alignment["y"]
        self.h = alignment["h"]
        self.landmarksXY = alignment["landmarksXY"]

    def face_to_alignment(self, alignment):
        """ Convert a face alignment to detected face object """
        alignment["x"] = self.x
        alignment["w"] = self.w
        alignment["y"] = self.y
        alignment["h"] = self.h
        alignment["landmarksXY"] = self.landmarksXY
        return alignment

    def landmarks_as_xy(self):
        """ Landmarks as XY """
        return self.landmarksXY


 </s> add 
        self.trainer_name = trainer_name
        if trainer_name.lower() == "lowmem":
            self.trainer_name = "LowMem"
          self.lock = threading.Lock()
  
          # this is so that you can enter case insensitive values for trainer
          trainer_name = self.args.trainer
        self.trainer_name = trainer_name
        if trainer_name.lower() == "lowmem":
            self.trainer_name = "LowMem"
          self.timelapse = None
  
      def process(self):
          """ Call the training process object """
          print("Training data directory: {}".format(self.args.model_dir))
keep keep keep keep replace keep keep keep keep keep
 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 
scripts/train.py