| from PIL import Image | |
| import gradio as gr | |
| def convert_to_greyscale(img): | |
| grey_img = img.convert("L") | |
| return grey_img | |
| iface = gr.Interface( | |
| fn=convert_to_greyscale, | |
| inputs=gr.Image(type="pil"), | |
| outputs="image", | |
| title="Image to Greyscale Converter", | |
| description="Upload any image and it will be converted into a greyscale version." | |
| ) | |
| iface.launch() | |