Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from PIL import Image
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
def convert_to_greyscale(img):
|
| 5 |
+
grey_img = img.convert("L")
|
| 6 |
+
return grey_img
|
| 7 |
+
|
| 8 |
+
iface = gr.Interface(
|
| 9 |
+
fn=convert_to_greyscale,
|
| 10 |
+
inputs=gr.Image(type="pil"),
|
| 11 |
+
outputs="image",
|
| 12 |
+
title="Image to Greyscale Converter",
|
| 13 |
+
description="Upload any image and it will be converted into a greyscale version."
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
iface.launch()
|