unclecode commited on
Commit
18d6eb2
·
1 Parent(s): ebffd5b

Initial commit

Browse files
Files changed (2) hide show
  1. app.py +13 -4
  2. requirements.txt +2 -0
app.py CHANGED
@@ -1,7 +1,16 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
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