import gradio as gr import cv2 as cv def annotate(image): cv.rectangle(image, (int(10), int(10)), (int(100), int(100)), color = (0, 0, 255), thickness = 3) return image webcam = gr.Image(sources = ["webcam"], streaming = True, render= False) webapp = gr.Interface(live = True, fn=annotate, inputs=webcam, outputs="video") webapp.launch()