              face,
              256,
              self.faces.align_eyes)
  
          blurry_file = self.faces.detect_blurry_faces(face,
                                                       t_mat,
                                                       resized_face,
                                                       filename)
          output_file = blurry_file if blurry_file else output_file
  
          if self.export_face:
              filename = "{}_{}{}".format(str(output_file),
                                          str(idx),
                                          Path(filename).suffix)
 
</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         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 = 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) </s> remove     def detect_blurry_faces(self, face, t_mat, resized_image, filename):
        """ Detect and move blurry face """
        if not hasattr(self.args, 'blur_thresh') or not self.args.blur_thresh:
            return None
 </s> add         return input_images </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")
            final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
              face,
              256,
              self.faces.align_eyes)
  
            final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
            final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
            final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
            final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
            final_faces.append(face.to_alignment())
        self.alignments.data[os.path.basename(filename)] = final_faces
  
          if self.export_face:
              filename = "{}_{}{}".format(str(output_file),
                                          str(idx),
                                          Path(filename).suffix)
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