Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
# ์ด๋ฏธ์ง ์ธ์ ํ์ดํ๋ผ์ธ ๋ก๋ | |
model = pipeline("image-classification") | |
def classify_image(image): | |
predictions = model(image) | |
return predictions | |
# Gradio ์ธํฐํ์ด์ค ์์ฑ | |
iface = gr.Interface(fn=classify_image, | |
inputs=gr.inputs.Image(shape=(224, 224)), | |
outputs=gr.outputs.Label(num_top_classes=3), | |
title="์ด๋ฏธ์ง ๋ถ๋ฅ๊ธฐ", | |
description="์ด๋ฏธ์ง๋ฅผ ์ ๋ก๋ํ๋ฉด, ์ฌ๋ฌผ์ ์ธ์ํ๊ณ ์ค๋ช ์ ์ถ๋ ฅํฉ๋๋ค.") | |
# ์ธํฐํ์ด์ค ์คํ | |
iface.launch() | |