Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Wybierz lżejszy model | |
| model_name = "facebook/deit-tiny-patch16-224" | |
| pipe = pipeline("image-classification", model=model_name) | |
| def classify_image(img): | |
| results = pipe(img) | |
| return {res["label"]: float(res["score"]) for res in results} | |
| demo = gr.Interface( | |
| fn=classify_image, | |
| inputs=gr.Image(type="filepath"), | |
| outputs=gr.Label(num_top_classes=5), | |
| title="Lekka klasyfikacja obrazów", | |
| description=f"Model: {model_name}" | |
| ) | |
| demo.launch() |