Spaces:
Runtime error
Runtime error
seawolf2357
commited on
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# ์ด๋ฏธ์ง ์ธ์ ํ์ดํ๋ผ์ธ ๋ก๋
|
5 |
+
model = pipeline("image-classification")
|
6 |
+
|
7 |
+
def classify_image(image):
|
8 |
+
predictions = model(image)
|
9 |
+
return predictions
|
10 |
+
|
11 |
+
# Gradio ์ธํฐํ์ด์ค ์์ฑ
|
12 |
+
iface = gr.Interface(fn=classify_image,
|
13 |
+
inputs=gr.inputs.Image(shape=(224, 224)),
|
14 |
+
outputs=gr.outputs.Label(num_top_classes=3),
|
15 |
+
title="์ด๋ฏธ์ง ๋ถ๋ฅ๊ธฐ",
|
16 |
+
description="์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๋ฉด, ์ฌ๋ฌผ์ ์ธ์ํ๊ณ ์ค๋ช
์ ์ถ๋ ฅํฉ๋๋ค.")
|
17 |
+
|
18 |
+
# ์ธํฐํ์ด์ค ์คํ
|
19 |
+
iface.launch()
|