Spaces:
Sleeping
Sleeping
์ ์ํ
commited on
Commit
ยท
0924a8f
1
Parent(s):
e9f1ced
test
Browse files- app.py +24 -0
- models/best.pt +3 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import PIL.Image as Image
|
3 |
+
from ultralytics import YOLO
|
4 |
+
|
5 |
+
|
6 |
+
model = YOLO('./models/best.pt')
|
7 |
+
|
8 |
+
def infer(img_path):
|
9 |
+
results = model(img_path)
|
10 |
+
|
11 |
+
im_array = results[0].plot()
|
12 |
+
im = Image.fromarray(im_array[..., ::-1])
|
13 |
+
return im
|
14 |
+
|
15 |
+
|
16 |
+
article = "**์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ์ธ์.**" \
|
17 |
+
|
18 |
+
demo = gr.Interface(fn=infer,
|
19 |
+
inputs=gr.Image(type="numpy", label="Input Image"),
|
20 |
+
outputs=gr.Image(type="pil", label="Result")
|
21 |
+
# examples=[image_path,]
|
22 |
+
)
|
23 |
+
|
24 |
+
demo.launch()
|
models/best.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1dd302218b154d57bb4971bb9c5908d64484af51703a90bd427377841a481811
|
3 |
+
size 6258543
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ultralytics
|