  
      def show(self, image, name=''):
          try:
              if self.arguments.preview:
                  self.preview_buffer[name] = image
              elif self.arguments.write_image:
                  cv2.imwrite('_sample_{}.jpg'.format(name), image)
          except Exception as e:
              print("could not preview sample")
              print(e)
 
</s> remove 
 </s> add         except Exception as e:
            print(e)
            exit(1)
     </s> remove         for filename in self.read_directory():
 </s> add         for filename in tqdm(self.read_directory()): </s> remove                     for name, image in self.preview_buffer.items():
                        cv2.imshow(name, image)
 </s> add                     with self.lock:
                        for name, image in self.preview_buffer.items():
                            cv2.imshow(name, image) </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))
                with self.lock:
                    self.preview_buffer[name] = image
  
      def show(self, image, name=''):
          try:
              if self.arguments.preview:
                with self.lock:
                    self.preview_buffer[name] = image
              elif self.arguments.write_image:
                  cv2.imwrite('_sample_{}.jpg'.format(name), image)
          except Exception as e:
              print("could not preview sample")
              print(e)
keep keep keep keep replace keep keep keep 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/train.py