victorisgeek commited on
Commit
ea735df
·
verified ·
1 Parent(s): 7ee87ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -13
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 Gradio Interface
73
- iface = gr.Interface(
74
- fn=predictor.predict,
75
- inputs=[
76
- gr.Image(type="filepath", label="Target Image"),
77
- gr.Image(type="filepath", label="Swap Image")
78
- ],
79
- outputs=gr.Image(type="filepath", label="Result"),
80
- title=title,
81
- examples=[["input.jpg", "swap img.jpg"]]
82
- )
 
 
 
 
 
 
 
83
 
84
  # Launch the Gradio Interface
85
- iface.launch()
 
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()