mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-06 10:25:17 +08:00
8464aa7258
* 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
14 lines
236 B
Python
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()
|