  
  def convert_one_image(image, model_dir="models"):
  
      encoder.load_weights(model_dir + "/encoder.h5")
      decoder_A.load_weights(model_dir + "/decoder_A.h5")
      decoder_B.load_weights(model_dir + "/decoder_B.h5")
  
      autoencoder = autoencoder_B
  
      shapePredictor = "contrib/shape_predictor_68_face_landmarks.dat"
      humanFaceDetector = "contrib/mmod_human_face_detector.dat"
 
</s> remove def convert_one_image(image, model_dir="models"):
 </s> add def convert_one_image(image, 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' </s> remove                 new_face = convert_one_image(cv2.resize(face.image, (256, 256)), self.arguments.model_dir)
 </s> add                 new_face = convert_one_image(cv2.resize(face.image, (256, 256)), self.arguments.model_dir, self.arguments.swap_model) </s> remove     # result = aligner.align(image.copy(), new_face)
    # if result is None:
    #     return superpose(image, new_face, crop)
    # else:
    #     return result
 </s> add     if use_aligner:
        return aligner.align(image.copy(), new_face)
    else:
        return superpose(image, new_face, crop) </s> remove     aligner = Aligner(shapePredictor, humanFaceDetector)
 </s> add     if use_aligner:
        aligner = Aligner(shapePredictor, humanFaceDetector) </s> remove     return superpose(image, new_face, crop)
 </s> add 
    decoder_A.load_weights(model_dir + face_A)
    decoder_B.load_weights(model_dir + face_B)
  
  def convert_one_image(image, model_dir="models"):
  
      encoder.load_weights(model_dir + "/encoder.h5")
    decoder_A.load_weights(model_dir + face_A)
    decoder_B.load_weights(model_dir + face_B)
    decoder_A.load_weights(model_dir + face_A)
    decoder_B.load_weights(model_dir + face_B)
  
      autoencoder = autoencoder_B
  
      shapePredictor = "contrib/shape_predictor_68_face_landmarks.dat"
      humanFaceDetector = "contrib/mmod_human_face_detector.dat"
keep keep keep keep replace replace keep keep keep keep keep
 Allow users to swap the A/B models (#29)

* Allow users to swap the conversion models. 
lib/faces_process.py