mulas / app.py
pcreem's picture
0709
1e7b2ff
raw
history blame contribute delete
322 Bytes
import torch
from ultralytics import YOLO
import gradio as gr
model = YOLO("best0709.pt") # 或者是從 hf_hub_download 取得
def detect(image):
results = model(image)
return results[0].plot() # 回傳帶框圖像
iface = gr.Interface(fn=detect, inputs="image", outputs="image")
iface.launch(show_api=True)