Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,6 +37,7 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
| 37 |
roop.globals.frame_processors = ["face_swapper", "face_enhancer"]
|
| 38 |
else:
|
| 39 |
roop.globals.frame_processors = ["face_swapper"]
|
|
|
|
| 40 |
roop.globals.headless = True
|
| 41 |
roop.globals.keep_fps = True
|
| 42 |
roop.globals.keep_audio = True
|
|
@@ -67,12 +68,19 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
| 67 |
roop.globals.frame_processors
|
| 68 |
):
|
| 69 |
if not frame_processor.pre_check():
|
|
|
|
| 70 |
return
|
| 71 |
|
| 72 |
start()
|
| 73 |
return output_path
|
| 74 |
|
| 75 |
app = gr.Interface(
|
| 76 |
-
fn=swap_face,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
)
|
| 78 |
app.launch()
|
|
|
|
| 37 |
roop.globals.frame_processors = ["face_swapper", "face_enhancer"]
|
| 38 |
else:
|
| 39 |
roop.globals.frame_processors = ["face_swapper"]
|
| 40 |
+
|
| 41 |
roop.globals.headless = True
|
| 42 |
roop.globals.keep_fps = True
|
| 43 |
roop.globals.keep_audio = True
|
|
|
|
| 68 |
roop.globals.frame_processors
|
| 69 |
):
|
| 70 |
if not frame_processor.pre_check():
|
| 71 |
+
print(f"Pre-check failed for {frame_processor}")
|
| 72 |
return
|
| 73 |
|
| 74 |
start()
|
| 75 |
return output_path
|
| 76 |
|
| 77 |
app = gr.Interface(
|
| 78 |
+
fn=swap_face,
|
| 79 |
+
inputs=[
|
| 80 |
+
gr.Image(),
|
| 81 |
+
gr.Image(),
|
| 82 |
+
gr.Checkbox(label="Face Enhancer?", info="Do face enhancement?")
|
| 83 |
+
],
|
| 84 |
+
outputs="image"
|
| 85 |
)
|
| 86 |
app.launch()
|