Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import spaces
|
| 2 |
import numpy as np
|
| 3 |
import gradio as gr
|
| 4 |
import roop.globals
|
|
@@ -13,7 +12,7 @@ from roop.utilities import normalize_output_path
|
|
| 13 |
import os
|
| 14 |
from PIL import Image
|
| 15 |
|
| 16 |
-
|
| 17 |
def swap_face(source_file, target_file, doFaceEnhancer):
|
| 18 |
|
| 19 |
source_path = "input.jpg"
|
|
@@ -64,9 +63,18 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
| 64 |
start()
|
| 65 |
return output_path
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
with app:
|
|
|
|
|
|
|
| 70 |
gr.Interface(
|
| 71 |
fn=swap_face,
|
| 72 |
inputs=[gr.Image(), gr.Image(), gr.Checkbox(label="face_enhancer?", info="do face enhancer?")],
|
|
|
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import gradio as gr
|
| 3 |
import roop.globals
|
|
|
|
| 12 |
import os
|
| 13 |
from PIL import Image
|
| 14 |
|
| 15 |
+
|
| 16 |
def swap_face(source_file, target_file, doFaceEnhancer):
|
| 17 |
|
| 18 |
source_path = "input.jpg"
|
|
|
|
| 63 |
start()
|
| 64 |
return output_path
|
| 65 |
|
| 66 |
+
|
| 67 |
+
html_section_1 = "<div><h1>Welcome to the NSFW Face Swap & API</h1></div>"
|
| 68 |
+
|
| 69 |
+
html_section_2 = """<div><p>Upload your source and target images to swap faces.
|
| 70 |
+
Optionally, use the face enhancer feature for HD Results"""
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
app = gr.Blocks(theme="Nymbo/Nymbo_Theme")
|
| 74 |
|
| 75 |
with app:
|
| 76 |
+
gr.HTML(html_section_1)
|
| 77 |
+
gr.HTML(html_section_2)
|
| 78 |
gr.Interface(
|
| 79 |
fn=swap_face,
|
| 80 |
inputs=[gr.Image(), gr.Image(), gr.Checkbox(label="face_enhancer?", info="do face enhancer?")],
|