Spaces:
Running
Running
Initial commit
Browse files- app.py +13 -4
- requirements.txt +2 -0
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
5 |
|
6 |
-
demo = gr.Interface(
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from PIL import Image
|
3 |
|
4 |
+
def grayscale(input_image):
|
5 |
+
# Convert to grayscale
|
6 |
+
return input_image.convert("L")
|
7 |
|
8 |
+
demo = gr.Interface(
|
9 |
+
fn=grayscale,
|
10 |
+
inputs=gr.Image(type="pil"),
|
11 |
+
outputs=gr.Image(type="pil"),
|
12 |
+
title="Grayscale Transformer"
|
13 |
+
)
|
14 |
+
|
15 |
+
if __name__ == "__main__":
|
16 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
Pillow
|