Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# Load your cloned model from Hugging Face | |
model_name = "sumeetemail27/clothnew" | |
tryon_pipeline = pipeline("image-to-image", model=model_name) | |
# Define a function to process images | |
def virtual_tryon(input_image): | |
output_image = tryon_pipeline(input_image) | |
return output_image | |
# Create Gradio UI | |
demo = gr.Interface( | |
fn=virtual_tryon, | |
inputs=gr.Image(type="pil"), | |
outputs=gr.Image(type="pil"), | |
title="Virtual Clothes Try-On AI", | |
description="Upload an image to try on clothes using AI." | |
) | |
# Launch the app | |
demo.launch() | |