          self.output_dir = get_folder(self.args.output_dir)
          logger.info("Output Directory: %s", self.args.output_dir)
          self.images = Images(self.args)
          self.alignments = Alignments(self.args, True, self.images.is_video)
          self.plugins = Plugins(self.args)
  
          self.post_process = PostProcess(arguments)
  
          self.verify_output = False
          self.save_interval = None
          if hasattr(self.args, "save_interval"):
 
</s> remove 
 </s> add         self.extractor = Extractor(self.args.detector,
                                   self.args.aligner,
                                   self.args.loglevel,
                                   self.args.multiprocess,
                                   self.args.rotate_images,
                                   self.args.min_size)

        self.save_queue = queue_manager.get_queue("extract_save") </s> remove     def run_extraction(self):
        """ Run Face Detection """
        save_queue = queue_manager.get_queue("extract_out")
        to_process = self.process_item_count()
        frame_no = 0
        size = self.args.size if hasattr(self.args, "size") else 256
        align_eyes = self.args.align_eyes if hasattr(self.args, "align_eyes") else False

        if self.plugins.is_parallel:
            logger.debug("Using parallel processing")
            self.plugins.launch_aligner()
            self.plugins.launch_detector()
        if not self.plugins.is_parallel:
            logger.debug("Using serial processing")
            self.run_detection(to_process)
            self.plugins.launch_aligner()

        for faces in tqdm(self.plugins.detect_faces(extract_pass="align"),
                          total=to_process,
                          file=sys.stdout,
                          desc="Extracting faces"):

            filename = faces["filename"]

            self.align_face(faces, align_eyes, size, filename)
            self.post_process.do_actions(faces)

            faces_count = len(faces["detected_faces"])
            if faces_count == 0:
                logger.verbose("No faces were detected in image: %s",
                               os.path.basename(filename))

            if not self.verify_output and faces_count > 1:
                self.verify_output = True

            self.output_faces(filename, faces, save_queue)

            frame_no += 1
            if frame_no == self.save_interval:
                self.alignments.save()
                frame_no = 0

        save_queue.put("EOF")

 </s> add  </s> remove     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)
 </s> add     def run_extraction(self):
        """ Run Face Detection """
        to_process = self.process_item_count()
        size = self.args.size if hasattr(self.args, "size") else 256
        align_eyes = self.args.align_eyes if hasattr(self.args, "align_eyes") else False
        exception = False

        for phase in range(self.extractor.passes): </s> remove         self.threaded_io("reload", detected_faces)
 </s> add         if not self.verify_output and faces_count > 1:
            self.verify_output = True
          self.output_dir = get_folder(self.args.output_dir)
          logger.info("Output Directory: %s", self.args.output_dir)
          self.images = Images(self.args)
          self.alignments = Alignments(self.args, True, self.images.is_video)


          self.post_process = PostProcess(arguments)
  
          self.verify_output = False
          self.save_interval = None
          if hasattr(self.args, "save_interval"):
keep keep keep keep replace replace keep keep keep keep keep
 Face filter vgg face (#724)

* Implement extraction pipeline

* Face filter to vgg_face. Resume partial model downloads

* On-the-fly conversion to extraction pipeline

* Move git model ids from get_model to model definition 
scripts/extract.py