mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
92889b7b93
* 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
18 lines
268 B
Python
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()
|