Ashrafb commited on
Commit
a2bfe0a
1 Parent(s): 9b56244

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -2,6 +2,8 @@ import streamlit as st
2
  import subprocess
3
  import shutil
4
  import os
 
 
5
 
6
  def run_scripts(target, source, use_face_enhancer):
7
  if target is None or (not use_face_enhancer and source is None):
@@ -43,9 +45,9 @@ def main():
43
 
44
  if st.button("Swap Faces"):
45
  with st.spinner("Swapping Faces..."):
46
- output_path = swap_face(
47
- np.array(source_image),
48
- np.array(target_image),
49
  doFaceEnhancer,
50
  )
51
  output_image = Image.open(output_path)
 
2
  import subprocess
3
  import shutil
4
  import os
5
+ from PIL import Image
6
+ import numpy as np
7
 
8
  def run_scripts(target, source, use_face_enhancer):
9
  if target is None or (not use_face_enhancer and source is None):
 
45
 
46
  if st.button("Swap Faces"):
47
  with st.spinner("Swapping Faces..."):
48
+ output_path = run_scripts(
49
+ target_file,
50
+ source_file if not doFaceEnhancer else None,
51
  doFaceEnhancer,
52
  )
53
  output_image = Image.open(output_path)