File size: 1,911 Bytes
f91b95e
 
 
 
 
 
 
3e853a6
f91b95e
59dd53a
f91b95e
 
b9291b9
f91b95e
b9291b9
5a315d5
f91b95e
 
 
 
 
b9291b9
f91b95e
 
71eea71
eac7374
00bd7cf
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', './data/0210.jpg', './data/IMG_7078.jpg', './data/IMG_7103.jpg', './data/IMG_7705.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='<p>This model is trained to detect one Cheerios box in an indoor setting, and it is trained using synthetic data from the Duality.ai simulation software: FalconEditor. <a href="https://falcon.duality.ai/secure/documentation?learnWelcome=true&sidebarMode=learn" target="_blank">Try FalconEditor today</a>, and see if you can train a more robust model that functions in a larger variety of domains!</p> In a world where data regulations are starting to limit AI useage, FalconEditor offers a way to obtain large, regulation-passing datasets easily and quickly. Dive into synthetic data by creating a FREE learner account at <a href="https://falcon.duality.ai/secure/documentation?learnWelcome=true&sidebarMode=learn" target="_blank">falcon.duality.ai</a>. Follow along with tutorials as we walk you through how to assemble a scenario and collect data for AI training. Used by companies like P&G, KEF Robotics, and AWS, this powerful software is now available for non-commercial use. <p><a href="https://falcon.duality.ai/secure/documentation?learnWelcome=true&sidebarMode=learn" target="_blank">Sign up now, and start creating!</a></p>',
    examples= path,
   # gradio.HTML(https://falcon.duality.ai/secure/documentation?learnWelcome=true&sidebarMode=learn),
)

# Launch the interface
iface.launch()