Weaita commited on
Commit
4650f40
·
1 Parent(s): a212421

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -1,10 +1,18 @@
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_output
 
 
 
 
 
 
 
8
 
9
  # Create a simple GUI
10
  gr.Interface(fn=flip_image,
 
1
  import gradio as gr
2
  import numpy as np
3
+ import zipfile
4
 
5
  # Simple function to flip an image upside down
6
  def flip_image(image):
7
+ # Open image and convert it to png
8
+ image = Image.open(image)
9
+ image.save("image.png", "PNG")
10
+
11
+ # Create zip file
12
+ zip_file = "image.zip"
13
+ with zipfile.ZipFile(zip_file, 'w') as zip:
14
+ zip.write("image.png")
15
+ return zip_file
16
 
17
  # Create a simple GUI
18
  gr.Interface(fn=flip_image,