Sanjayraju30 commited on
Commit
96dad42
·
verified ·
1 Parent(s): c7ccf18

Create ui.py

Browse files
Files changed (1) hide show
  1. ui.py +15 -0
ui.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+
4
+ def build_ui(try_on_fn, styles):
5
+ with gr.Blocks(title="Salon Hairstyle Virtual Try-On") as demo:
6
+ gr.Markdown("## 💇‍♀️ Salon Hairstyle Virtual Try-On")
7
+ with gr.Row():
8
+ with gr.Column():
9
+ inp = gr.Image(type="numpy", label="Upload or capture", sources=["upload", "webcam"])
10
+ style = gr.Dropdown(choices=styles, label="Choose a hairstyle", interactive=True)
11
+ btn = gr.Button("Try On")
12
+ with gr.Column():
13
+ out = gr.Image(type="numpy", label="Result", interactive=False)
14
+ btn.click(fn=try_on_fn, inputs=[inp, style], outputs=out)
15
+ return demo