gradio/demo/blocks_webcam/run.py
Ömer Faruk Özdemir 8464aa7258
Refactor component shortcuts (#995)
* custom-components
- create template components
- changes in PKG and requires comes from scripts/install_gradio.sh

* custom-components
- tweaks

* update-components
- tweaks

* update-components
- fix get_block_name

* update-components
- add webcam demo

* custom-components
- make use of get_block_name function whenever possible

* custom-components
- tweaks

* refactor-component-shortcuts
- no description whatsoever :D

* refactor-component-shortcuts
- tweaks

* refactor-component-shortcuts
- create shortcut function "component"

* refactor-component-shortcuts
- reformat

* refactor-component-shortcuts
- tweaks

* refactor-component-shortcuts
- tweaks
2022-04-15 00:24:14 +03:00

14 lines
236 B
Python

import numpy as np
import gradio as gr
from gradio import Templates
def snap(image):
return np.flipud(image)
demo = gr.Interface(snap, gr.component("webcam"), gr.component("image"))
if __name__ == "__main__":
demo.launch()