experiment with b&w
Browse files
app.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from PIL import Image
|
| 3 |
+
|
| 4 |
+
def bw(image_file:Image):
|
| 5 |
+
img = Image.open(image_file)
|
| 6 |
+
img = img.convert("L")
|
| 7 |
+
return img
|
| 8 |
+
|
| 9 |
+
iface = gr.Interface(fn=bw, inputs=gr.Image(type='filepath'), outputs=["image"])
|
| 10 |
+
iface.launch()
|