Dricz's picture
Update app.py
ec20b40 verified
raw
history blame
343 Bytes
import gradio as gr
import matplotlib.pyplot as plt
from PIL import Image
from ultralytics import YOLO
model = YOLO('best (1).pt')
def response(image):
img = Image.fromarray(image)
results = model(img)
# Plot results image
return results
iface = gr.Interface(fn=response, inputs="image", outputs="image")
iface.launch()