              filename, image, faces = item
              skip = self.opts.check_skipframe(filename)
  
              if not skip:
                  for idx, face in faces:
                      image = self.convert_one_face(converter,
                                                    (filename, image, idx, face))
              if skip != "discard":
                  filename = str(self.output_dir / Path(filename).name)
                  Utils.cv2_read_write('write', filename, image)
 
</s> remove             if skip != "discard":
 </s> add  </s> remove                 Utils.cv2_read_write('write', filename, image)
 </s> add                 cv2.imwrite(filename, image) </s> remove             yield filename, image, faces
 </s> add         for rawface in faces:
            face = DetectedFace()
            face.from_alignment(rawface, image=image)
            detected_faces.append(face)
        return image, detected_faces </s> remove             image = Utils.cv2_read_write('read', filename)
            faces = self.faces.get_faces_alignments(filename, image)
            if not faces:
 </s> add             frame = os.path.basename(filename)
            if self.extract_faces:
                convert_item = self.detect_faces(filename)
            else:
                convert_item = self.alignments_faces(filename, frame)

            if not convert_item: </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")
                for idx, face in enumerate(faces):
              filename, image, faces = item
              skip = self.opts.check_skipframe(filename)
  
              if not skip:
                for idx, face in enumerate(faces):
                      image = self.convert_one_face(converter,
                                                    (filename, image, idx, face))
              if skip != "discard":
                  filename = str(self.output_dir / Path(filename).name)
                  Utils.cv2_read_write('write', filename, image)
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/convert.py