Spaces:
Running
Running
| import gradio as gr | |
| from PIL import Image | |
| def convert_to_grayscale(input_path): | |
| # Open the image file | |
| img = Image.open(input_path) | |
| # Convert the image to grayscale | |
| return img.convert('L') | |
| iface = gr.Interface (fn = convert_to_grayscale, | |
| inputs= gr.Image (type='filepath'), | |
| outputs= gr.Image()) | |
| iface.launch () |