Weaita commited on
Commit
b801442
·
1 Parent(s): b245327

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -1,11 +1,15 @@
1
  import gradio as gr
2
  import numpy as np
3
- from PIL import Image
4
 
5
- def invert_image(image):
6
- image = Image.open(image)
7
- inverted_image = Image.fromarray(np.array(image)[::-1])
8
- return inverted_image
9
-
10
- iface = gr.Interface(invert_image, "image", "image", live=True)
11
- iface.launch()
 
 
 
 
 
 
1
  import gradio as gr
2
  import numpy as np
 
3
 
4
+ # Simple function to flip an image upside down
5
+ def flip_image(image):
6
+ image_output = np.flipud(image)
7
+ return image, image_output
8
+
9
+ # Create a simple GUI
10
+ gr.Interface(fn=flip_image,
11
+ inputs="image",
12
+ outputs=["image","image"],
13
+ title="Flip An Image Upside Down",
14
+ examples = ["ai_images.png"]
15
+ ).launch();