Spaces:
Runtime error
Runtime error
Download app.py from watanabe3tipapa/processing-ce: direct link, hf CLI and curl.
- Browser
- Download file 921 Bytes
-
https://huggingface.co/spaces/watanabe3tipapa/processing-ce/resolve/main/app.py
- Command line
-
hf download hf://spaces/watanabe3tipapa/processing-ce/app.py
-
curl -L -o app.py https://huggingface.co/spaces/watanabe3tipapa/processing-ce/resolve/main/app.py
921 Bytes
| import numpy as np | |
| import gradio as gr | |
| # Palindromes, mirror processing, etc. | |
| def flip_text(x): | |
| return x[::-1] | |
| def flip_image(x): | |
| return np.fliplr(x) | |
| with gr.Blocks() as demo: | |
| gr.Markdown("回文とかミラー加工とか...") | |
| with gr.Tab("Textを入力"): | |
| text_input = gr.Textbox() | |
| text_output = gr.Textbox() | |
| text_button = gr.Button("回文作成!") | |
| with gr.Tab("ImageをUpload"): | |
| with gr.Row(): | |
| image_input = gr.Image() | |
| image_output = gr.Image() | |
| image_button = gr.Button("ミラー加工します") | |
| with gr.Accordion("説明"): | |
| gr.Markdown("Textboxを入力してください。 ImageをUploadでは画像のミラー加工ができますよ。") | |
| text_button.click(flip_text, inputs=text_input, outputs=text_output) | |
| image_button.click(flip_image, inputs=image_input, outputs=image_output) | |
| demo.launch() |