  
  # Based on: https://gist.github.com/anonymous/d3815aba83a8f79779451262599b0955
  
  class Convert():
      def __init__(self, autoencoder):
          self.autoencoder = autoencoder
  
          # if args.erosionKernelSize > 0:
          #     self.erosion_kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(args.erosionKernelSize,args.erosionKernelSize))
          # else:
          #     self.erosion_kernel = None
 
</s> remove # Based on: https://gist.github.com/anonymous/d3815aba83a8f79779451262599b0955

 </s> add  </s> remove     def __init__(self, autoencoder):
        self.autoencoder = autoencoder
 </s> add     def __init__(self, encoder):
        self.encoder = encoder </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 
class DetectedFace(object):
    def __init__(self, image, x, w, y, h, landmarks):
        self.image = image
        self.x = x
        self.w = w
        self.y = y
        self.h = h
        self.landmarks = landmarks </s> add 
    def __init__(self, encoder):
        self.encoder = encoder

  
  # Based on: https://gist.github.com/anonymous/d3815aba83a8f79779451262599b0955
  
  class Convert():
    def __init__(self, encoder):
        self.encoder = encoder
    def __init__(self, encoder):
        self.encoder = encoder
  
          # if args.erosionKernelSize > 0:
          #     self.erosion_kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(args.erosionKernelSize,args.erosionKernelSize))
          # else:
          #     self.erosion_kernel = None
keep keep keep keep 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 
plugins/Convert_Masked.py