DualityAI-RebekahBogdanoff/Synthetic_Data_Object_Detection
5
1import gradio as gr2import cv23import requests4import os5 6from ultralytics import YOLO7 8path = ['./data/0068.jpg', './data/0210.jpg', './data/IMG_7078.jpg', './data/IMG_7103.jpg', './data/IMG_7705.jpg']9 10model_path = './best.pt'11model = YOLO(model_path)12 13def detect_cheerios(image_path):14 # Run inference on the input image15 results = model(image_path)16 image = results[0].plot() [:,:,::-1]17 18 return image19 20iface = gr.Interface(21 fn=detect_cheerios,22 inputs=gr.components.Image(type="filepath", label="Input Image"),23 outputs=gr.Image(),24 title="Cheerios detector",25 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>',26 examples= path,27 # gradio.HTML(https://falcon.duality.ai/secure/documentation?learnWelcome=true&sidebarMode=learn),28)29 30# Launch the interface31iface.launch()