yolo / app.py
shenxy's picture
added Title
9fc2ffa
raw
history blame contribute delete
338 Bytes
import gradio as gr
from ultralytics import YOLO
def detect_objects(image):
model = YOLO('yolov8m.pt')
results = model(image)
annotated_image = results[0].plot()
return annotated_image
app = gr.Interface(
title="YOLOv8 目标检测 Demo",
fn=detect_objects,
inputs="image",
outputs="image")
app.launch()