  
      def load_model(self):
          """ Load the model requested for training """
          model_dir = get_folder(self.args.model_dir)
          model = PluginLoader.get_model(self.trainer_name)(model_dir, self.args.gpus)
  
          model.load(swapped=False)
          return model
  
      def load_trainer(self, model):
 
</s> remove     def generate_alignments(self):
        """ Generate an alignments file if one does not already
        exist. Does not save extracted faces """
        print('Alignments file not found. Generating at default values...')
        extract = Extract(self.args)
        extract.export_face = False
        extract.process()
 </s> add         Utils.finalize(self.images.images_found,
                       self.faces_count,
                       self.verify_output)

    def load_extractor(self):
        """ Set on the fly extraction """
        print("\nNo Alignments file found. Extracting on the fly.\n"
              "NB: This will use the inferior dlib-hog for extraction "
              "and dlib pose predictor for landmarks.\nIt is recommended "
              "to perfom Extract first for superior results\n")
        for task in ("load", "detect", "align"):
            queue_manager.add_queue(task, maxsize=0)

        detector = PluginLoader.get_detector("dlib_hog")(
            verbose=self.args.verbose)
        aligner = PluginLoader.get_aligner("dlib")(verbose=self.args.verbose)

        d_kwargs = {"in_queue": queue_manager.get_queue("load"),
                    "out_queue": queue_manager.get_queue("detect")}
        a_kwargs = {"in_queue": queue_manager.get_queue("detect"),
                    "out_queue": queue_manager.get_queue("align")}

        d_process = SpawnProcess()
        d_event = d_process.event
        a_process = SpawnProcess()
        a_event = a_process.event

        d_process.in_process(detector.detect_faces, **d_kwargs)
        a_process.in_process(aligner.align, **a_kwargs)
        d_event.wait(10)
        if not d_event.is_set():
            raise ValueError("Error inititalizing Detector")
        a_event.wait(10)
        if not a_event.is_set():
            raise ValueError("Error inititalizing Aligner")

        self.extract_faces = True </s> remove             self.generate_alignments()

        self.faces.faces_detected = self.alignments.read_alignments()
 </s> add             self.load_extractor() </s> remove         self.faces_detected = dict()
        self.num_faces_detected = 0
        self.verify_output = False
 </s> add         return data </s> remove     @staticmethod
    def load_extractor(extractor_name="Align"):
        """ Load the requested extractor for extraction """
        extractor = PluginLoader.get_extractor(extractor_name)()
 </s> add     def save(self):
        """ Write the serialized alignments file """
        try:
            print("Writing alignments to: {}".format(self.location))
            with open(self.location, self.serializer.woptions) as align:
                align.write(self.serializer.marshal(self.data))
        except Exception as err:
            print("{} not written!".format(self.location))
            print(str(err)) </s> remove             self.timelapse = Timelapse.CreateTimelapse(self.args.timelapse_input_A,
                                                       self.args.timelapse_input_B,
                                                       self.args.timelapse_output,
                                                       trainer)
 </s> add             self.timelapse = Timelapse.create_timelapse(
                self.args.timelapse_input_A,
                self.args.timelapse_input_B,
                self.args.timelapse_output,
                trainer)
        model = PluginLoader.get_model(self.trainer_name)(model_dir,
                                                          self.args.gpus)
  
      def load_model(self):
          """ Load the model requested for training """
          model_dir = get_folder(self.args.model_dir)
        model = PluginLoader.get_model(self.trainer_name)(model_dir,
                                                          self.args.gpus)
  
          model.load(swapped=False)
          return model
  
      def load_trainer(self, model):
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