import gradio as gr # Define the function to process the webcam input def capture_image(image): # You can process the image if you want. Here, we just return it. return image # Create the Gradio interface interface = gr.Interface( fn=capture_image, # Function to process the image inputs=gr.Image(source="webcam"), # Capture webcam image outputs=gr.Image(), # Display the captured image live=True # Make it responsive ) # Launch the interface interface.launch()