Spaces:
Sleeping
Sleeping
File size: 556 Bytes
d06e1fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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() |