Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|