Spaces:
Sleeping
Sleeping
File size: 402 Bytes
ad4f85a 73be0f0 3cdd5bd 2774232 73be0f0 3cdd5bd 73be0f0 9afb57c 5ddefa2 3cdd5bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import gradio as gr
from PIL import Image
def resize_image(image):
new_width=360
new_height=image.height*new_width//image.width
resized_image = image.resize((new_width, new_height))
return resized_image
iface = gr.Interface(fn=resize_image,
inputs=[gr.Image(type="pil")],
outputs=gr.Image(type="pil", label="360width Image")
)
iface.launch() |