tryon-app / app.py
dariushh's picture
create app.py
676d55f verified
raw
history blame contribute delete
818 Bytes
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()