          """ Perform processing on found faces """
          output_file = self.output_dir / Path(
              filename).stem if self.export_face else None
  
          self.faces.draw_landmarks_on_face(face, image)
  
          resized_face, t_mat = self.faces.extractor.extract(
              image,
              face,
              256,
 
</s> remove         output_file = self.output_dir / Path(
            filename).stem if self.export_face else None
 </s> add         final_faces = list()
        save_queue = queue_manager.get_queue("save") </s> remove     def process_single_face(self, idx, face, filename, image):
 </s> add         self.threaded_io("reload", detected_faces)

    def process_faces(self, filename, faces): </s> remove         resized_face, t_mat = self.faces.extractor.extract(
            image,
            face,
            256,
            self.faces.align_eyes)
 </s> add         for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx)) </s> remove             retval = filename, final_faces
        except Exception as err:
            if self.args.verbose:
                print("Failed to extract from image: "
                      "{}. Reason: {}".format(filename, err))
            raise
        return retval
 </s> add         if processed != 0 and self.args.skip_existing:
            print("Skipping {} previously extracted frames".format(processed))
        if processed != 0 and self.args.skip_faces:
            print("Skipping {} frames with detected faces".format(processed))

        to_process = self.images.images_found - processed
        if to_process == 0:
            print("No frames to process. Exiting")
            queue_manager.terminate_queues()
            exit(0)
        return to_process

    def run_detection(self, to_process):
        """ Run detection only """
        self.plugins.launch_detector()
        detected_faces = dict()
        for detected in tqdm(self.plugins.detect_faces(extract_pass="detect"),
                             total=to_process,
                             file=sys.stdout,
                             desc="Detecting faces"):
            exception = detected.get("exception", False)
            if exception:
                break

            del detected["image"]
            filename = detected["filename"]

            detected_faces[filename] = detected </s> remove         blurry_file = self.faces.detect_blurry_faces(face,
                                                     t_mat,
                                                     resized_face,
                                                     filename)
        output_file = blurry_file if blurry_file else output_file
 </s> add             final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
        filename = faces["filename"]
        output_file = faces["output_file"]
        resized_faces = faces["resized_faces"]
          """ Perform processing on found faces """
          output_file = self.output_dir / Path(
              filename).stem if self.export_face else None
  
        filename = faces["filename"]
        output_file = faces["output_file"]
        resized_faces = faces["resized_faces"]
  
          resized_face, t_mat = self.faces.extractor.extract(
              image,
              face,
              256,
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/extract.py