Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # تحميل النموذج الجاهز من Hugging Face | |
| pipe = pipeline("image-to-image", model="wuilly50/GarmentTransfer") | |
| def try_on(person_img, cloth_img): | |
| result = pipe({"image": person_img, "garment": cloth_img}) | |
| return result[0]["image"] | |
| # واجهة التطبيق | |
| demo = gr.Interface( | |
| fn=try_on, | |
| inputs=[ | |
| gr.Image(label="صورة الشخص (المانيكان)"), | |
| gr.Image(label="صورة الزي (جاكيت / تيشيرت)") | |
| ], | |
| outputs=gr.Image(label="النتيجة - تجربة الزي"), | |
| title="Virtual Try-On App", | |
| description="ارفع صورة الشخص والزي، وسنجرب الملابس عليه." | |
| ) | |
| demo.launch() | |