Spaces:
Sleeping
Sleeping
Upload with huggingface_hub
Browse files
README.md
CHANGED
@@ -6,7 +6,6 @@ colorFrom: indigo
|
|
6 |
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
sdk_version: 3.4.1
|
9 |
-
|
10 |
-
app_file: app.py
|
11 |
pinned: false
|
12 |
---
|
|
|
6 |
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
sdk_version: 3.4.1
|
9 |
+
app_file: run.py
|
|
|
10 |
pinned: false
|
11 |
---
|
run.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def flip_text(x):
|
5 |
+
return x[::-1]
|
6 |
+
|
7 |
+
def flip_image(x):
|
8 |
+
return np.fliplr(x)
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown("Flip text or image files using this demo.")
|
12 |
+
with gr.Tab("Flip Text"):
|
13 |
+
text_input = gr.Textbox()
|
14 |
+
text_output = gr.Textbox()
|
15 |
+
text_button = gr.Button("Flip")
|
16 |
+
with gr.Tab("Flip Image"):
|
17 |
+
with gr.Row():
|
18 |
+
image_input = gr.Image()
|
19 |
+
image_output = gr.Image()
|
20 |
+
image_button = gr.Button("Flip")
|
21 |
+
|
22 |
+
with gr.Accordion("Open for More!"):
|
23 |
+
gr.Markdown("Look at me...")
|
24 |
+
|
25 |
+
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
26 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
demo.launch()
|