Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import gfpgan
|
|
| 6 |
import tempfile
|
| 7 |
import time
|
| 8 |
import gradio as gr
|
| 9 |
-
|
| 10 |
|
| 11 |
class Predictor:
|
| 12 |
def __init__(self):
|
|
@@ -69,17 +69,24 @@ class Predictor:
|
|
| 69 |
predictor = Predictor()
|
| 70 |
title = "🧸 Auto adjust Models 🧸"
|
| 71 |
|
| 72 |
-
# Create
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
# Launch the Gradio Interface
|
| 85 |
-
|
|
|
|
| 6 |
import tempfile
|
| 7 |
import time
|
| 8 |
import gradio as gr
|
| 9 |
+
from gradio.themes.utils.theme_dropdown import create_theme_dropdown # noqa: F401
|
| 10 |
|
| 11 |
class Predictor:
|
| 12 |
def __init__(self):
|
|
|
|
| 69 |
predictor = Predictor()
|
| 70 |
title = "🧸 Auto adjust Models 🧸"
|
| 71 |
|
| 72 |
+
# Create theme dropdown
|
| 73 |
+
dropdown, js = create_theme_dropdown()
|
| 74 |
+
|
| 75 |
+
# Create Gradio Interface with the specified theme
|
| 76 |
+
with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
|
| 77 |
+
with gr.Row(equal_height=True):
|
| 78 |
+
with gr.Column(scale=10):
|
| 79 |
+
iface = gr.Interface(
|
| 80 |
+
fn=predictor.predict,
|
| 81 |
+
inputs=[
|
| 82 |
+
gr.Image(type="filepath", label="Target Image"),
|
| 83 |
+
gr.Image(type="filepath", label="Swap Image")
|
| 84 |
+
],
|
| 85 |
+
outputs=gr.Image(type="filepath", label="Result"),
|
| 86 |
+
title=title,
|
| 87 |
+
examples=[["input.jpg", "swap img.jpg"]]
|
| 88 |
+
)
|
| 89 |
+
demo.append(dropdown)
|
| 90 |
|
| 91 |
# Launch the Gradio Interface
|
| 92 |
+
demo.launch()
|