JarvisLabs commited on
Commit
e93abef
1 Parent(s): 1de6488

Update virtualtryon_tab.py

Browse files
Files changed (1) hide show
  1. virtualtryon_tab.py +30 -30
virtualtryon_tab.py CHANGED
@@ -1,31 +1,31 @@
1
- from src.rep_api import virtual_try_on
2
- import gradio as gr
3
-
4
-
5
- def create_virtualtryon_tab():
6
- with gr.TabItem("Virtual Try-on",id="virtual_tryon"):
7
- with gr.Row():
8
- with gr.Column():
9
- human_img = gr.Image(label="Human Image")
10
- crop = gr.Checkbox(label="Crop", value=False)
11
- seed = gr.Number(label="Seed", value=42)
12
- steps = gr.Number(label="Steps", value=30)
13
- with gr.Column():
14
- garm_img = gr.Image(label="Garment Image")
15
- category = gr.Dropdown(["upper_body", "lower_body", "full_body"], label="Category", value="upper_body")
16
- garment_des = gr.Textbox(label="Garment Description")
17
- with gr.Row():
18
- tryon_btn = gr.Button("Try-on")
19
- with gr.Row():
20
- tryon_out = gr.Image(label="Output", type="filepath")
21
- with gr.Row():
22
- examples = gr.Examples(
23
- examples=[
24
- [ False, 42, 30, "upper_body", "Test_images/pink_jumper.png", "Test_images/person_1.jpg","pink jumper"],
25
- [ True, 100, 50, "upper_body", "Test_images/Suit_2.png", "Test_images/person_2.jpg","Suit"],
26
- # [ False, 7, 20, "full_body", "path/to/garment_img3.jpg", "path/to/human_img3.jpg","Black Suit"]
27
- ],
28
- inputs=[ crop, seed, steps, category, garm_img,human_img, garment_des]
29
- )
30
-
31
  tryon_btn.click(virtual_try_on, inputs=[crop, seed, steps, category, garm_img, human_img,garment_des],outputs=tryon_out)
 
1
+ from src.rep_api import virtual_try_on
2
+ import gradio as gr
3
+
4
+
5
+ def create_virtualtryon_tab():
6
+ with gr.TabItem("Virtual Try-on",id="virtual_tryon"):
7
+ with gr.Row():
8
+ with gr.Column():
9
+ human_img = gr.Image(label="Human Image")
10
+ crop = gr.Checkbox(label="Crop", value=False)
11
+ seed = gr.Number(label="Seed", value=42)
12
+ steps = gr.Number(label="Steps", value=30)
13
+ with gr.Column():
14
+ garm_img = gr.Image(label="Garment Image")
15
+ category = gr.Dropdown(["upper_body", "lower_body", "full_body"], label="Category", value="upper_body")
16
+ garment_des = gr.Textbox(label="Garment Description")
17
+ with gr.Row():
18
+ tryon_btn = gr.Button("Try-on")
19
+ with gr.Row():
20
+ tryon_out = gr.Image(label="Output", type="filepath")
21
+ with gr.Row():
22
+ examples = gr.Examples(
23
+ examples=[
24
+ [ False, 42, 30, "upper_body", "Test_images/pink_jumper.png", "Test_images/person_1.jpg","pink jumper"],
25
+ [ True, 100, 30, "upper_body", "Test_images/Suit_2.png", "Test_images/person_2.jpg","Suit"],
26
+ # [ False, 7, 20, "full_body", "path/to/garment_img3.jpg", "path/to/human_img3.jpg","Black Suit"]
27
+ ],
28
+ inputs=[ crop, seed, steps, category, garm_img,human_img, garment_des]
29
+ )
30
+
31
  tryon_btn.click(virtual_try_on, inputs=[crop, seed, steps, category, garm_img, human_img,garment_des],outputs=tryon_out)