Update app.py
Browse files
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 =
|
47 |
-
|
48 |
-
|
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)
|