Lin commited on
Commit
f8c3dcc
1 Parent(s): 39aff1a

Changed app

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -1,16 +1,15 @@
 
1
  import gradio as gr
2
 
3
- def greet(name, is_morning, temperature):
4
- salutation = "Good morning" if is_morning else "Good evening"
5
- greeting = f"{salutation} {name}. It is {temperature} degrees today"
6
- celsius = (temperature - 32) * 5 / 9
7
- return greeting, round(celsius, 2)
8
-
9
- demo = gr.Interface(
10
- fn=greet,
11
- inputs=["text", "checkbox", gr.Slider(0, 100)],
12
- outputs=["text", "number"],
13
- )
14
- if __name__ == "__main__":
15
- demo.launch()
16
 
 
 
 
1
+ import numpy as np
2
  import gradio as gr
3
 
4
+ def sepia(input_img):
5
+ sepia_filter = np.array([
6
+ [0.393, 0.769, 0.189],
7
+ [0.349, 0.686, 0.168],
8
+ [0.272, 0.534, 0.131]
9
+ ])
10
+ sepia_img = input_img.dot(sepia_filter.T)
11
+ sepia_img /= sepia_img.max()
12
+ return sepia_img
 
 
 
 
13
 
14
+ demo = gr.Interface(sepia, gr.Image(), "image")
15
+ demo.launch()