File size: 818 Bytes
676d55f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from PIL import Image
import time

def tryon_model(person_img, cloth_img):
    # Simulate processing
    time.sleep(2)
    
    # Combine person and cloth images side by side for demo
    person = person_img.convert("RGB").resize((256, 256))
    cloth = cloth_img.convert("RGB").resize((256, 256))
    output = Image.new("RGB", (512, 256))
    output.paste(person, (0, 0))
    output.paste(cloth, (256, 0))
    
    return output

demo = gr.Interface(
    fn=tryon_model,
    inputs=[
        gr.Image(type="pil", label="Person Image"),
        gr.Image(type="pil", label="Cloth Image")
    ],
    outputs=gr.Image(type="pil", label="Output Image"),
    title="TryOnGAN Demo",
    description="Upload a person image and a cloth image. The output shows a simulated try-on result.",
)

demo.launch()