Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,11 @@ from PIL import Image
|
|
| 4 |
def resize_image(image):
|
| 5 |
new_width=360
|
| 6 |
new_height=image.height*new_width//image.width
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
return "download.png"
|
| 10 |
|
| 11 |
iface = gr.Interface(fn=resize_image,
|
| 12 |
inputs=[gr.Image(type="pil")],
|
| 13 |
-
outputs="
|
| 14 |
|
| 15 |
iface.launch()
|
|
|
|
| 4 |
def resize_image(image):
|
| 5 |
new_width=360
|
| 6 |
new_height=image.height*new_width//image.width
|
| 7 |
+
resized_image = image.resize((new_width, new_height))
|
| 8 |
+
return resized_image
|
|
|
|
| 9 |
|
| 10 |
iface = gr.Interface(fn=resize_image,
|
| 11 |
inputs=[gr.Image(type="pil")],
|
| 12 |
+
outputs=gr.Image(type="pil", label="Resized Image")
|
| 13 |
|
| 14 |
iface.launch()
|