-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradio_app.py
51 lines (40 loc) · 1.61 KB
/
gradio_app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import gradio as gr
def select_model(model):
pass
def upload_cloth(cloth_image):
pass
def select_cloth(cloth_option):
pass
def upload_person(person_image):
pass
def select_person(person_option):
pass
def select_stage(stage):
pass
def try_on_model(inputs):
model, cloth, person, stage = inputs
# Fill in the actual implementation later
output_image = None
return output_image
model_select = gr.inputs.Dropdown(choices=['Model 1', 'Model 2', 'Model 3'], label="Select Model")
cloth_upload = gr.inputs.Image(label="Upload a Cloth")
cloth_select = gr.inputs.Radio(choices=['Cloth 1', 'Cloth 2', 'Cloth 3'], label="Select a Cloth")
person_upload = gr.inputs.Image(label="Upload a Person Wearing Clothes")
person_select = gr.inputs.Radio(choices=['Person 1', 'Person 2', 'Person 3'], label="Select a Person")
stage_select = gr.inputs.Dropdown(choices=['GMM', 'TOM', 'Try On'], label="Select Stage")
output_image = gr.outputs.Image(label="Output Image")
download_button = gr.outputs.Download(filename="output.png", label="Download Output Image")
gradio_ui = gr.Interface(
fn=try_on_model,
inputs=[model_select, gr.inputs.Image(label="Upload or Select a Cloth"), gr.inputs.Image(label="Upload or Select a Person"), stage_select],
outputs=[output_image, download_button],
layout="vertical",
title="Virtual Cloth Try-On",
description="Upload or select images of clothes and persons, and choose the stage to try on the clothes virtually.",
allow_flagging=False,
theme="huggingface",
custom_styles=True,
server_name="0.0.0.0",
server_port=8000,
)
gradio_ui.launch()