Spaces:
Sleeping
Sleeping
from PIL.Image import TRANSVERSE | |
import gradio as gr | |
def upload_image(x): | |
# ここに処理を書く | |
return 'アップロード完了' | |
def check_image(x): | |
# ここに処理を書く | |
return 'AI診断結果:リウマチです' | |
with gr.Blocks() as demo: | |
gr.Markdown("学習用画像アップロード&AI診断デモ") | |
with gr.Tabs(): | |
with gr.TabItem("left_画像収集"): | |
image_input_left = gr.Image() | |
left_button = gr.Button("アップロード") | |
text_output_left = gr.Textbox() | |
with gr.TabItem("right_画像収集"): | |
image_input_right = gr.Image() | |
right_button = gr.Button("アップロード") | |
text_output_right = gr.Textbox() | |
with gr.TabItem("AI診断"): | |
image_input = gr.Image() | |
right_left =gr.Radio(["右手","左手",]) | |
check_button = gr.Button("AI診断") | |
text_output = gr.Textbox() | |
left_button.click(upload_image, inputs=image_input_left, outputs=text_output_left) | |
right_button.click(upload_image, inputs=image_input_right, outputs=text_output_right) | |
check_button.click(check_image, inputs=image_input, outputs=text_output) | |
demo.launch() |