Team Ai
Apppublic

watanabe3tipapa/processing-ce

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes
app.py32 linesDownload Raw Back to root
1import numpy as np2import gradio as gr3 4# Palindromes, mirror processing, etc.5 6def flip_text(x):7    return x[::-1]8 9 10def flip_image(x):11    return np.fliplr(x)12 13 14with gr.Blocks() as demo:15    gr.Markdown("回文とかミラー加工とか...")16    with gr.Tab("Textを入力"):17        text_input = gr.Textbox()18        text_output = gr.Textbox()19        text_button = gr.Button("回文作成!")20    with gr.Tab("ImageをUpload"):21        with gr.Row():22            image_input = gr.Image()23            image_output = gr.Image()24        image_button = gr.Button("ミラー加工します")25 26    with gr.Accordion("説明"):27        gr.Markdown("Textboxを入力してください。  ImageをUploadでは画像のミラー加工ができますよ。")28 29    text_button.click(flip_text, inputs=text_input, outputs=text_output)30    image_button.click(flip_image, inputs=image_input, outputs=image_output)31 32demo.launch()