File size: 719 Bytes
f91b95e
 
 
 
 
 
 
 
4f5c6f8
f91b95e
59dd53a
f91b95e
 
b9291b9
f91b95e
b9291b9
5a315d5
f91b95e
 
 
 
 
b9291b9
f91b95e
 
f041bfb
38a8f42
f91b95e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import gradio as gr
import cv2
import requests
import os
 
from ultralytics import YOLO

path = ['./data/0068.jpg']
path0 = ['./data/0210.jpg']

model_path = './best.pt'
model = YOLO(model_path)

def detect_cheerios(image_path):
    # Run inference on the input image
    results = model(image_path)
    image = results[0].plot() [:,:,::-1]
    
    return image
 
iface = gr.Interface(
    fn=detect_cheerios,
    inputs=gr.components.Image(type="filepath", label="Input Image"),
    outputs=gr.Image(),
    title="Cheerios detector",
    description = "test description here with a lot of words to see how it looks irl... i wonder what size this will be",
    examples=path0, 
)

# Launch the interface
iface.launch()