Spaces:
Runtime error
Runtime error
tomaseo2022
commited on
Commit
•
e9cb9ea
1
Parent(s):
427d5cb
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,24 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
-
import os
|
3 |
|
4 |
|
5 |
-
def
|
6 |
-
return
|
7 |
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
if __name__ == "__main__":
|
18 |
-
demo.launch()
|
|
|
1 |
+
import numpy as np
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
|
5 |
+
def flip_text(x):
|
6 |
+
return x[::-1]
|
7 |
|
8 |
|
9 |
+
def flip_image(x):
|
10 |
+
return np.fliplr(x)
|
11 |
+
|
12 |
+
|
13 |
+
with gr.Blocks() as demo:
|
14 |
+
with gr.Tab(""):
|
15 |
+
with gr.Row():
|
16 |
+
image_input = gr.Image()
|
17 |
+
image_output = gr.Image()
|
18 |
+
image_button = gr.Button("Voltear")
|
19 |
+
|
20 |
+
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
21 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
22 |
|
23 |
if __name__ == "__main__":
|
24 |
+
demo.launch()
|