Vansim's picture
Add application file
bd8af31
raw
history blame contribute delete
567 Bytes
import gradio as gr
from transformers import pipeline
# Загружаем модель
classifier = pipeline("image-classification", model="mmgyorke/vit-world-landmarks")
def predict(img):
results = classifier(img)
return {r["label"]: float(r["score"]) for r in results}
demo = gr.Interface(
fn=predict,
inputs=gr.Image(type="pil"),
outputs=gr.Label(num_top_classes=5),
title="🏛️ World Landmark Classifier",
description="Загрузи фото и узнай, что за архитектурный объект!"
)
demo.launch()