RojaKatta commited on
Commit
d6ba375
Β·
verified Β·
1 Parent(s): e3d09f3

Create ui.py

Browse files
Files changed (1) hide show
  1. ui.py +19 -0
ui.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def create_interface(apply_fn, hairstyles):
4
+ with gr.Blocks() as demo:
5
+ gr.Markdown("## πŸ’‡ Salon Virtual Hairstyle Try-On (Face-Aligned, No Manual Adjustment Needed)")
6
+ with gr.Row():
7
+ with gr.Column():
8
+ img_input = gr.Image(type="pil", label="πŸ“€ Upload Your Image")
9
+ style_choice = gr.Slider(0, max(len(hairstyles)-1, 0), step=1, label="🎨 Select Hairstyle")
10
+ apply_btn = gr.Button("✨ Apply Hairstyle")
11
+ with gr.Column():
12
+ img_output = gr.Image(label="πŸ” Result Preview")
13
+
14
+ apply_btn.click(
15
+ fn=apply_fn,
16
+ inputs=[img_input, style_choice],
17
+ outputs=img_output
18
+ )
19
+ return demo