juyam commited on
Commit
2774232
·
1 Parent(s): 370f1eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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
- image = image.resize((new_width, new_height))
8
- image.save("download.png", 'PNG')
9
- return "download.png"
10
 
11
  iface = gr.Interface(fn=resize_image,
12
  inputs=[gr.Image(type="pil")],
13
- outputs="file")
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()