Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Amazon.com, Inc., doing business as Amazon, is an American electronic commerce and cloud computing company based in Seattle, Washington, that was founded by Jeff Bezos on July 5, 1994. The tech giant is the largest Internet retailer in the world as measured by revenue and market capitalization, and second largest after Alibaba Group in terms of total sales. The amazon.com website started as an online bookstore and later diversified to sell video downloads/streaming, MP3 downloads/streaming, audiobook downloads/streaming, software, video games, electronics, apparel, furniture, food, toys, and jewelry. The company also produces consumer electronics - Kindle e-readers, Fire tablets, Fire TV, and Echo - and is the world's largest provider of cloud infrastructure services (IaaS and PaaS). Amazon also sells certain low-end products under its in-house brand Amazon Basics
|
| 2 |
+
========================================
|
| 3 |
+
import numpy as np
|
| 4 |
+
import gradio as gr
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def flip_text(x):
|
| 8 |
+
return x[::-1]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def flip_image(x):
|
| 12 |
+
return np.fliplr(x)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
with gr.Blocks() as demo:
|
| 16 |
+
gr.Markdown("Flip text or image files using this demo.")
|
| 17 |
+
with gr.Tab("Flip Text"):
|
| 18 |
+
text_input = gr.Textbox()
|
| 19 |
+
text_output = gr.Textbox()
|
| 20 |
+
text_button = gr.Button("Flip")
|
| 21 |
+
with gr.Tab("Flip Image"):
|
| 22 |
+
with gr.Row():
|
| 23 |
+
image_input = gr.Image()
|
| 24 |
+
image_output = gr.Image()
|
| 25 |
+
image_button = gr.Button("Flip")
|
| 26 |
+
|
| 27 |
+
with gr.Accordion("Open for More!"):
|
| 28 |
+
gr.Markdown("Look at me...")
|
| 29 |
+
|
| 30 |
+
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
| 31 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
| 32 |
+
|
| 33 |
+
demo.launch()
|