gradio/demo/webcam.py

15 lines
246 B
Python
Raw Normal View History

2020-08-26 07:36:45 +08:00
# Demo: (Image) -> (Image)
2020-08-22 07:17:11 +08:00
2020-06-11 14:04:14 +08:00
import gradio as gr
2020-09-22 07:46:10 +08:00
import numpy as np
2020-08-28 23:56:03 +08:00
2020-06-11 14:04:14 +08:00
def snap(image):
2020-08-22 07:17:11 +08:00
return np.flipud(image)
2020-06-11 14:04:14 +08:00
2020-08-28 23:56:03 +08:00
io = gr.Interface(snap, gr.inputs.Image(shape=(100,100), image_mode="L", source="webcam"), "image")
io.test_launch()
io.launch()