from ultralytics import YOLO import gradio as gr from gradio_webrtc import WebRTC # Load the YOLO model model = YOLO("yolo11n.pt") def detect_objects(frame, conf_threshold=0.3): results = model(frame, conf=conf_threshold) annotated_frame = results[0].plot() return annotated_frame css = """.my-group {max-width: 600px !important; max-height: 600px !important;} .my-column {display: flex !important; justify-content: center !important; align-items: center !important;}""" with gr.Blocks(css=css) as demo: gr.HTML( "