Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Modèle simple sans segmentation | |
| model = pipeline("zero-shot-image-classification", | |
| model="openai/clip-vit-base-patch32") | |
| categories = ["t-shirt", "dress", "jeans", "jacket", "shoes"] | |
| def classify(image): | |
| results = model(image, candidate_labels=categories) | |
| return "\n".join([f"{r['label']}: {r['score']*100:.1f}%" for r in results]) | |
| gr.Interface( | |
| fn=classify, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Textbox(), | |
| title="Simple Fashion Classifier" | |
| ).launch() |