File size: 420 Bytes
aeeb601 afc670e aeeb601 fee70a2 aeeb601 3fe3c0c afc670e 3fe3c0c 9e2718e afc670e 21c6654 afc670e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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):
for i, r in enumerate(results):
# Plot results image
im_bgr = r.plot() # BGR-order numpy array
im_rgb = im_bgr[..., ::-1] # Convert BGR to RGB
return im_rgb
iface = gr.Interface(fn=response, inputs="image", outputs="image")
iface.launch() |