          extractor_name = "Align" # TODO Pass as argument
          extractor = PluginLoader.get_extractor(extractor_name)()
  
          try:
              for filename in self.read_directory():
                  image = cv2.imread(filename)
                  for idx, face in self.get_faces(image):
                      resized_image = extractor.extract(image, face, 256)
                      output_file = self.output_dir / Path(filename).stem
                      cv2.imwrite(str(output_file) + str(idx) + Path(filename).suffix, resized_image)
                  
          except Exception as e:
              print('Failed to extract from image: {}. Reason: {}'.format(filename, e))
 
</s> remove         extractor = PluginLoader.get_extractor(extractor_name)()
 </s> add         self.extractor = PluginLoader.get_extractor(extractor_name)()
        self.faces_detected = 0
        processes = self.arguments.processes
        if processes != 1:
            files = list(self.read_directory())
            for _ in tqdm(pool_process(self.processFiles, files, processes=processes), total = len(files)):
                self.faces_detected +=1
        else:
            try:
                for filename in tqdm(self.read_directory()):
                    self.handleImage(filename)

            except Exception as e:
                print('Failed to extract from image: {}. Reason: {}'.format(filename, e)) </s> remove         for filename in self.read_directory():
 </s> add         for filename in tqdm(self.read_directory()): </s> remove             skip = self.check_skip(filename)

            if not skip: # process as normal
 </s> add             if not self.check_skipframe(filename): # process as normal </s> remove         
 </s> add     def add_optional_arguments(self, parser):
        parser.add_argument('-D', '--detector',
                            type=str,
                            choices=("hog", "cnn"), # case sensitive because this is used to load a plugin.
                            default="hog",
                            help="Detector to use. 'cnn' detects much more angles but will be much more resource intensive and may fail on large files.")

        parser.add_argument('-f', '--filter',
                            type=str,
                            dest="filter",
                            default="filter.jpg",
                            help="Reference image for the person you want to process. Should be a front portrait"
                            )

        parser.add_argument('-j', '--processes',
                            type=int,
                            help="Number of processes to use.")
        return parser

            return self.handleImage(filename)
          extractor_name = "Align" # TODO Pass as argument
          extractor = PluginLoader.get_extractor(extractor_name)()
  
          try:
            return self.handleImage(filename)
            return self.handleImage(filename)
            return self.handleImage(filename)
            return self.handleImage(filename)
            return self.handleImage(filename)
            return self.handleImage(filename)
            return self.handleImage(filename)
          except Exception as e:
              print('Failed to extract from image: {}. Reason: {}'.format(filename, e))
keep keep keep keep replace replace replace replace replace replace replace keep keep
 Misc updates on master before GAN. Added multithreading + mmod face detector (#109)

* Preparing GAN plugin

* Adding multithreading for extract

* Adding support for mmod human face detector

* Adding face filter argument

* Added process number argument to multiprocessing extractor.

Fixed progressbar for multiprocessing.

* Added tiff as image type.
compression artefacts hurt my feelings.

* Cleanup 
scripts/extract.py