File size: 1,113 Bytes
bddf3b8
 
 
88157ff
 
bddf3b8
88157ff
34e47b3
88157ff
0c6cc50
34e47b3
 
 
0c6cc50
 
08cd01d
0c6cc50
1fae26d
08cd01d
 
bddf3b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from SegCloth import segment_clothing

def segment(img, clothes):
    return segment_clothing(img, clothes)

iface = gr.Interface(fn=segment, 
                     inputs=[gr.Image(type='pil', label='Image'),
                             gr.Dropdown(choices=["Hat", "Upper-clothes", "Skirt", "Pants", "Dress", "Belt", "Left-shoe", "Right-shoe", "Scarf"],
                                         value=["Hat", "Upper-clothes", "Skirt", "Pants", "Dress", "Belt", "Left-shoe", "Right-shoe", "Scarf"],
                                         multiselect=True,
                                         label='Clothing')], 
                     outputs=gr.Image(label='Clothing Segmentation'),
                     title='Clothing Segmentation',
                     description="""
                     Upload an image to segment out clothing.
                     """,
                     examples=[['./1.jpg', ["Hat", "Upper-clothes", "Skirt", "Pants", "Dress", "Belt", "Left-shoe", "Right-shoe", "Scarf"]]],
                     theme = "Nymbo/Alyx_Theme"
                    )
iface.launch()