Spaces:
Build error
Build error
Download app.py from juyam/input_test: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/spaces/juyam/input_test/resolve/main/app.py
- Command line
-
hf download hf://spaces/juyam/input_test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/juyam/input_test/resolve/main/app.py
402 Bytes
| 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() |