pcreem commited on
Commit
449dc64
·
1 Parent(s): 34b7fc6
Files changed (3) hide show
  1. app.py +12 -0
  2. best0625.pt +3 -0
  3. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from ultralytics import YOLO
3
+ import gradio as gr
4
+
5
+ model = YOLO("best0625.pt") # 或者是從 hf_hub_download 取得
6
+
7
+ def detect(image):
8
+ results = model(image)
9
+ return results[0].plot() # 回傳帶框圖像
10
+
11
+ iface = gr.Interface(fn=detect, inputs="image", outputs="image")
12
+ iface.launch()
best0625.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6550b7ee01b41d3e14918c42966f47722ff6530302dc6574994ed67649e057b0
3
+ size 6218787
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ultralytics
2
+ gradio
3
+ torch