  from lib.model import autoencoder_B
  from lib.model import encoder, decoder_A, decoder_B
  
  class Convert(object):
      def __init__(self,
                  model_dir="models",
                  swap_model=False,
                  use_aligner=False):
          face_A = '/decoder_A.h5' if not swap_model else '/decoder_B.h5'
          face_B = '/decoder_B.h5' if not swap_model else '/decoder_A.h5'
  
          encoder.load_weights(model_dir + "/encoder.h5")
          decoder_A.load_weights(model_dir + face_A)
          decoder_B.load_weights(model_dir + face_B)
  
          self.autoencoder = autoencoder_B
  
      def convert_one_image(self,image, 
                          use_smooth_mask=True,
                          use_avg_color_adjust=True):
          assert image.shape == (256, 256, 3)
          crop = slice(48, 208)
          face = image[crop, crop]
          old_face = face.copy()
  
          face = cv2.resize(face, (64, 64))
 
</s> remove             print('Failed to extract from image: {}. Reason: {}'.format(filename, e))
 </s> add             print('Failed to convert image: {}. Reason: {}'.format(filename, e)) </s> remove         return cv2.resize(face.image, size) </s> add 
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
  from lib.model import autoencoder_B
  from lib.model import encoder, decoder_A, decoder_B
  
  class Convert(object):
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
    def __init__(self, autoencoder):
        self.autoencoder = autoencoder
         
        self.use_smooth_mask=True
        self.use_avg_color_adjust=True

    def convert_one_image( self, original, face_detected ):
        #assert image.shape == (256, 256, 3)
        image = cv2.resize(face_detected.image, (256, 256))
          crop = slice(48, 208)
          face = image[crop, crop]
          old_face = face.copy()
  
          face = cv2.resize(face, (64, 64))
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Adding new plugins (Extract_Align & Convert_Masked) 
plugins/Convert_Adjust.py