          except Exception as e:
              print('Failed to convert image: {}. Reason: {}'.format(filename, e))
  
      def prepare_images(self):
          for filename in self.read_directory():
              image = cv2.imread(filename)
              yield filename, image, self.get_faces(image)
 
</s> remove             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)
                
 </s> add             return self.handleImage(filename) </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                 self.preview_buffer[name] = image
 </s> add                 with self.lock:
                    self.preview_buffer[name] = image </s> remove 
 </s> add         except Exception as e:
            print(e)
            exit(1)
    
        for filename in tqdm(self.read_directory()):
          except Exception as e:
              print('Failed to convert image: {}. Reason: {}'.format(filename, e))
  
      def prepare_images(self):
        for filename in tqdm(self.read_directory()):
              image = cv2.imread(filename)
              yield filename, image, self.get_faces(image)
keep keep keep keep 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/convert.py