hi
Browse files- app.py +12 -0
- best0625.pt +3 -0
- 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
|