                              default=False,
                              help="Swap the model. Instead of A -> B, swap B -> A.")
          return parser
  
      def process_image(self, filename):
          # TODO move the model load and the converter creation in a method called on init, but after the arg parsing
          (face_A,face_B) = ('/decoder_A.h5', '/decoder_B.h5') if not self.arguments.swap_model else ('/decoder_B.h5', '/decoder_A.h5')
  
          model_dir = self.arguments.model_dir
          encoder.load_weights(model_dir + "/encoder.h5")
          decoder_A.load_weights(model_dir + face_A)
          decoder_B.load_weights(model_dir + face_B)
 
</s> remove     parser = argparse.ArgumentParser()
 </s> add     parser = FullHelpArgumentParser() </s> remove 
        self.finalize()
 </s> add     
    def get_faces(self, image):
        faces_count = 0
        for face in detect_faces(image):
            if self.filter is not None and not self.filter.check(face):
                print('Skipping not recognized face!')
                continue

            yield faces_count, face

            self.faces_detected = self.faces_detected + 1
            faces_count +=1
        
        if faces_count > 0 and self.arguments.verbose:
            print('Note: Found more than one face in an image!')
            self.verify_output = True
    
    def load_filter(self):
        filter_file = "filter.jpg" # TODO Pass as argument
        if Path(filter_file).exists():
            print('Loading reference image for filtering')
            return FaceFilter(filter_file) </s> remove         try:
            encoder.load_weights(self.arguments.model_dir + '/encoder.h5')
            decoder_A.load_weights(self.arguments.model_dir + '/decoder_A.h5')
            decoder_B.load_weights(self.arguments.model_dir + '/decoder_B.h5')
        except Exception as e:
            print('Not loading existing training data.')
            print(e)

 </s> add  </s> remove     try:
        arguments.func(arguments)
    except:
        parser.print_help()
 </s> add     arguments.func(arguments) </s> remove     def save_model_weights(self):
        encoder.save_weights(self.arguments.model_dir + '/encoder.h5')
        decoder_A.save_weights(self.arguments.model_dir + '/decoder_A.h5')
        decoder_B.save_weights(self.arguments.model_dir + '/decoder_B.h5')
        print('save model weights')

    def show_sample(self, test_A, test_B):
        figure_A = numpy.stack([
            test_A,
            autoencoder_A.predict(test_A),
            autoencoder_B.predict(test_A),
        ], axis=1)
        figure_B = numpy.stack([
            test_B,
            autoencoder_B.predict(test_B),
            autoencoder_A.predict(test_B),
        ], axis=1)

        figure = numpy.concatenate([figure_A, figure_B], axis=0)
        figure = figure.reshape((4, 7) + figure.shape[1:])
        figure = stack_images(figure)

        figure = numpy.clip(figure * 255, 0, 255).astype('uint8')

        if self.arguments.preview is True:
            cv2.imshow('', figure)
        if not self.arguments.preview or self.arguments.write_image:
            cv2.imwrite('_sample.jpg', figure)

 </s> add 
    def process(self):
        # Original model goes with Adjust or Masked converter
        model_name = "Original" # TODO Pass as argument
        conv_name = "Masked" # TODO Pass as argument
                              default=False,
                              help="Swap the model. Instead of A -> B, swap B -> A.")
          return parser
  
    def process(self):
        # Original model goes with Adjust or Masked converter
        model_name = "Original" # TODO Pass as argument
        conv_name = "Masked" # TODO Pass as argument
    def process(self):
        # Original model goes with Adjust or Masked converter
        model_name = "Original" # TODO Pass as argument
        conv_name = "Masked" # TODO Pass as argument
    def process(self):
        # Original model goes with Adjust or Masked converter
        model_name = "Original" # TODO Pass as argument
        conv_name = "Masked" # TODO Pass as argument
  
          model_dir = self.arguments.model_dir
          encoder.load_weights(model_dir + "/encoder.h5")
          decoder_A.load_weights(model_dir + face_A)
          decoder_B.load_weights(model_dir + face_B)
keep keep keep keep replace replace replace keep keep keep keep keep
 Adding models as plugins + Face filtering (#53) + #39 + #43 + #44 + #49 (#61)

* Making Models as plugins

* Do not reload model on each image #39 + Adding FaceFilter #53

* Adding @lukaville PR for #43 and #44 (possibly)

* Training done in a separate thread

* Better log for plugin load

* Adding a prefetch to train.py #49
(Note that we prefetch 2 batches of images, due to the queue behavior)
+ More compact logging with verbose info included

* correction of DirectoryProcessor signature

* adding missing import

* Convert with parallel preprocessing of files

* Added coverage var for trainer

Added a var with comment. Feel free to add it as argument

* corrections

* Modifying preview and normalization of image + correction

* Cleanup 
scripts/convert.py