DualityAI-RebekahBogdanoff's picture
Update app.py
eac7374 verified
raw
history blame
720 Bytes
import gradio as gr
import cv2
import requests
import os
from ultralytics import YOLO
path = ['./data/0068.jpg', './data/0210.jpg']
path0 = []
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= path,
)
# Launch the interface
iface.launch()