              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,
              self.faces.align_eyes)
  
          blurry_file = self.faces.detect_blurry_faces(face,
                                                       t_mat,
                                                       resized_face,
                                                       filename)
 
</s> remove         self.faces.draw_landmarks_on_face(face, image)
 </s> add         filename = faces["filename"]
        output_file = faces["output_file"]
        resized_faces = faces["resized_faces"] </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 </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         blurry_file = None
        aligned_landmarks = self.extractor.transform_points(
            face.landmarks_as_xy(),
            t_mat,
            256,
            48)
        feature_mask = self.extractor.get_feature_mask(aligned_landmarks / 256,
                                                       256,
                                                       48)
        feature_mask = cv2.blur(feature_mask, (10, 10))
        isolated_face = cv2.multiply(
            feature_mask,
            resized_image.astype(float)).astype(np.uint8)
        blurry, focus_measure = is_blurry(isolated_face, self.args.blur_thresh)

        if blurry:
            print("{}'s focus measure of {} was below the blur threshold, "
                  "moving to \"blurry\"".format(Path(filename).stem,
                                                focus_measure))
            blurry_file = get_folder(Path(self.output_dir) /
                                     Path("blurry")) / Path(filename).stem
        return blurry_file
 </s> add     def load(self):
        """ Load an image and yield it with it's filename """
        for filename in self.input_images:
            yield filename, cv2.imread(filename)
        for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx))
              filename).stem if self.export_face else None
  
          self.faces.draw_landmarks_on_face(face, image)
  
        for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx))
        for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx))
        for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx))
        for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx))
        for idx, face in enumerate(faces["detected_faces"]):
            if self.export_face:
                save_queue.put((filename,
                                output_file,
                                resized_faces[idx],
                                idx))
  
          blurry_file = self.faces.detect_blurry_faces(face,
                                                       t_mat,
                                                       resized_face,
                                                       filename)
keep keep keep keep replace replace replace replace 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