kumay / app.py
pcreem's picture
hi
449dc64
raw
history blame
309 Bytes
import torch
from ultralytics import YOLO
import gradio as gr
model = YOLO("best0625.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()