gradio/demo/webcam.py

16 lines
264 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
2021-03-03 09:07:52 +08:00
iface = gr.Interface(snap, gr.inputs.Image(source="webcam", tool=None), "image")
2020-08-28 23:56:03 +08:00
2020-11-11 22:15:53 +08:00
iface.test_launch()
if __name__ == "__main__":
iface.launch()