gradio/demo/webcam/run.py
pngwn 92889b7b93
1220 mirror webcam (#1686)
* support webcam mirroring for images

* flip video in preprocessor

* finalise webcam mirroring

* address review comments

* fix formatting

* improve video UI

* fix tests

* fix tests again
2022-07-05 17:30:02 +01:00

18 lines
268 B
Python

import numpy as np
import gradio as gr
def snap(image, video):
return [image, video]
demo = gr.Interface(
snap,
[gr.Image(source="webcam", tool=None), gr.Video(source="webcam")],
["image", "video"],
)
if __name__ == "__main__":
demo.launch()