seawolf2357 commited on
Commit
2bd9468
ยท
verified ยท
1 Parent(s): 52fd323

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
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()