์ „์›ํ‘œ commited on
Commit
0924a8f
ยท
1 Parent(s): e9f1ced
Files changed (3) hide show
  1. app.py +24 -0
  2. models/best.pt +3 -0
  3. 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