Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,20 +7,20 @@ def flip_text(x):
|
|
7 |
def flip_image(x):
|
8 |
return np.fliplr(x)
|
9 |
|
10 |
-
with gr.Blocks() as
|
11 |
-
gr.Markdown("
|
12 |
with gr.Tabs():
|
13 |
-
with gr.TabItem("
|
14 |
-
text_input = gr.Textbox()
|
15 |
-
text_output = gr.Textbox()
|
16 |
-
text_button = gr.Button("
|
17 |
-
with gr.TabItem("
|
18 |
with gr.Row():
|
19 |
-
image_input = gr.Image()
|
20 |
-
image_output = gr.Image()
|
21 |
-
image_button = gr.Button("
|
22 |
|
23 |
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
24 |
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
25 |
|
26 |
-
|
|
|
7 |
def flip_image(x):
|
8 |
return np.fliplr(x)
|
9 |
|
10 |
+
with gr.Blocks() as app:
|
11 |
+
gr.Markdown("#翻转文本或图像")
|
12 |
with gr.Tabs():
|
13 |
+
with gr.TabItem("翻转文本"):
|
14 |
+
text_input = gr.Textbox(label="输入")
|
15 |
+
text_output = gr.Textbox(label="结果")
|
16 |
+
text_button = gr.Button("翻转")
|
17 |
+
with gr.TabItem("翻转图像"):
|
18 |
with gr.Row():
|
19 |
+
image_input = gr.Image(label="输入")
|
20 |
+
image_output = gr.Image(label="结果")
|
21 |
+
image_button = gr.Button("翻转")
|
22 |
|
23 |
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
24 |
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
25 |
|
26 |
+
app.launch()
|