nuoxi commited on
Commit
56ebd80
1 Parent(s): c99d2ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
 
3
  def greet(name):
@@ -5,3 +6,16 @@ def greet(name):
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
  import gradio as gr
3
 
4
  def greet(name):
 
6
 
7
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
8
  iface.launch()
9
+
10
+ def sepia(input_img):
11
+ sepia_filter = np.array([
12
+ [0.393, 0.769, 0.189],
13
+ [0.349, 0.686, 0.168],
14
+ [0.272, 0.534, 0.131]
15
+ ])
16
+ sepia_img = input_img.dot(sepia_filter.T)
17
+ sepia_img /= sepia_img.max()
18
+ return sepia_img
19
+
20
+ demo = gr.Interface(sepia, gr.Image(), "image")
21
+ demo.launch()