File size: 539 Bytes
0cef02f
 
aa4ed98
 
 
 
2d6fc22
aa4ed98
 
 
 
 
 
 
2ec7210
aa4ed98
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()