tomaseo2022 commited on
Commit
e9cb9ea
1 Parent(s): 427d5cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -1,18 +1,24 @@
 
1
  import gradio as gr
2
- import os
3
 
4
 
5
- def video_identity(image):
6
- return image
7
 
8
 
9
- demo = gr.Interface(video_identity,
10
- gr.Image(),
11
- "playable_video",
12
- examples=[
13
- os.path.join(os.path.dirname(__file__),
14
- "video/video_sample.mp4")],
15
- cache_examples=True)
 
 
 
 
 
 
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()