Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ import os
|
|
15 |
from PIL import Image
|
16 |
|
17 |
|
18 |
-
def swap_face(source_file, target_file,
|
19 |
|
20 |
source_path = "input.jpg"
|
21 |
target_path = "target.jpg"
|
@@ -35,7 +35,7 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
35 |
roop.globals.source_path, roop.globals.target_path, output_path
|
36 |
)
|
37 |
if doFaceEnhancer == True:
|
38 |
-
roop.globals.frame_processors = ["face_swapper",
|
39 |
else:
|
40 |
roop.globals.frame_processors = ["face_swapper"]
|
41 |
roop.globals.headless = True
|
@@ -67,10 +67,6 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
67 |
|
68 |
|
69 |
app = gr.Interface(
|
70 |
-
fn=swap_face,
|
71 |
-
inputs=[gr.Image(), gr.Image(), gr.Checkbox(label="face_enhancer?", info="do face enhancer?")],
|
72 |
-
outputs="image"
|
73 |
)
|
74 |
-
|
75 |
-
# Launch the Gradio interface with the specified theme
|
76 |
-
app.launch(theme="xiaobaiyuan/theme_brief")
|
|
|
15 |
from PIL import Image
|
16 |
|
17 |
|
18 |
+
def swap_face(source_file, target_file,doFaceEnhancer):
|
19 |
|
20 |
source_path = "input.jpg"
|
21 |
target_path = "target.jpg"
|
|
|
35 |
roop.globals.source_path, roop.globals.target_path, output_path
|
36 |
)
|
37 |
if doFaceEnhancer == True:
|
38 |
+
roop.globals.frame_processors = ["face_swapper","face_enhancer"]
|
39 |
else:
|
40 |
roop.globals.frame_processors = ["face_swapper"]
|
41 |
roop.globals.headless = True
|
|
|
67 |
|
68 |
|
69 |
app = gr.Interface(
|
70 |
+
fn=swap_face, inputs=[gr.Image(), gr.Image(),gr.Checkbox(label="face_enhancer?", info="do face enhancer?")], outputs="image"
|
|
|
|
|
71 |
)
|
72 |
+
app.launch()
|
|
|
|