Spaces:
Sleeping
Sleeping
Download app.py from unclecode/image-grayscale: direct link, hf CLI and curl.
- Browser
- Download file 362 Bytes
-
https://huggingface.co/spaces/unclecode/image-grayscale/resolve/main/app.py
- Command line
-
hf download hf://spaces/unclecode/image-grayscale/app.py
-
curl -L -o app.py https://huggingface.co/spaces/unclecode/image-grayscale/resolve/main/app.py
362 Bytes
| import gradio as gr | |
| from PIL import Image | |
| def grayscale(input_image): | |
| # Convert to grayscale | |
| return input_image.convert("L") | |
| demo = gr.Interface( | |
| fn=grayscale, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Image(type="pil"), | |
| title="Grayscale Transformer" | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch(server_name="0.0.0.0", server_port=7860) | |