  from .model import autoencoder_B
  from .model import encoder, decoder_A, decoder_B
  
  
  def smooth_mask(img_old,img_new):
      w,h,c = img_new.shape
      crop = slice(0,w)
      mask = numpy.zeros_like(img_new)
 
</s> remove def convert_one_image(image, model_dir="models", swap_model=False, use_aligner=False):
 </s> add def smooth_mask(img_old,img_new):
    w,h,c = img_new.shape
    crop = slice(0,w)
    mask = numpy.zeros_like(img_new)
    mask[h//15:-h//15,w//15:-w//15,:] = 255
    mask = cv2.GaussianBlur(mask,(15,15),10)
    img_new[crop,crop] = mask/255*img_new + (1-mask/255)*img_old
def adjust_avg_color(img_old,img_new):
    w,h,c = img_new.shape
    for i in range(img_new.shape[-1]):
        old_avg = img_old[:, :, i].mean()
        new_avg = img_new[:, :, i].mean()
        diff_int = (int)(old_avg - new_avg)
        for m in range(img_new.shape[0]):
            for n in range(img_new.shape[1]):
                temp = (img_new[m,n,i] + diff_int)
                if temp < 0:
                    img_new[m,n,i] = 0
                elif temp > 255:
                    img_new[m,n,i] = 255
                else:
                    img_new[m,n,i] = temp
  from .model import autoencoder_B
  from .model import encoder, decoder_A, decoder_B
  
def adjust_avg_color(img_old,img_new):
    w,h,c = img_new.shape
    for i in range(img_new.shape[-1]):
        old_avg = img_old[:, :, i].mean()
        new_avg = img_new[:, :, i].mean()
        diff_int = (int)(old_avg - new_avg)
        for m in range(img_new.shape[0]):
            for n in range(img_new.shape[1]):
                temp = (img_new[m,n,i] + diff_int)
                if temp < 0:
                    img_new[m,n,i] = 0
                elif temp > 255:
                    img_new[m,n,i] = 255
                else:
                    img_new[m,n,i] = temp
  
  def smooth_mask(img_old,img_new):
      w,h,c = img_new.shape
      crop = slice(0,w)
      mask = numpy.zeros_like(img_new)
keep keep add keep keep keep keep keep
 Adjust color average and smooth mask (#31) 
lib/faces_process.py