Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import os
|
|
6 |
def run_scripts(target, source, use_face_enhancer):
|
7 |
if target is None or (not use_face_enhancer and source is None):
|
8 |
return None
|
|
|
9 |
target_extension = os.path.splitext(target.name)[-1]
|
10 |
output_path1 = "output1" + target_extension
|
11 |
output_path2 = "output2" + target_extension
|
@@ -22,7 +23,8 @@ def run_scripts(target, source, use_face_enhancer):
|
|
22 |
if not use_face_enhancer:
|
23 |
os.remove(source.name)
|
24 |
os.remove(target.name)
|
25 |
-
|
|
|
26 |
return output_path2
|
27 |
|
28 |
iface = gr.Interface(
|
@@ -30,7 +32,7 @@ iface = gr.Interface(
|
|
30 |
inputs=[
|
31 |
"file",
|
32 |
"file",
|
33 |
-
gr.inputs.Checkbox(default=False, label="Use only Face Enhancer")
|
34 |
],
|
35 |
outputs="file",
|
36 |
title="Face swapper",
|
|
|
6 |
def run_scripts(target, source, use_face_enhancer):
|
7 |
if target is None or (not use_face_enhancer and source is None):
|
8 |
return None
|
9 |
+
|
10 |
target_extension = os.path.splitext(target.name)[-1]
|
11 |
output_path1 = "output1" + target_extension
|
12 |
output_path2 = "output2" + target_extension
|
|
|
23 |
if not use_face_enhancer:
|
24 |
os.remove(source.name)
|
25 |
os.remove(target.name)
|
26 |
+
|
27 |
+
# Return the file path so it gets displayed in the Gradio UI
|
28 |
return output_path2
|
29 |
|
30 |
iface = gr.Interface(
|
|
|
32 |
inputs=[
|
33 |
"file",
|
34 |
"file",
|
35 |
+
gr.inputs.Checkbox(default=False, label="Use only Face Enhancer")
|
36 |
],
|
37 |
outputs="file",
|
38 |
title="Face swapper",
|