dog commited on
Commit
02ba6e1
1 Parent(s): 187bbd5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import gradio as gr
3
+
4
+
5
+ def sepia(image):
6
+ sepia_filter = np.array(
7
+ [[0.393, 0.769, 0.189],
8
+ [0.349, 0.686, 0.168],
9
+ [0.272, 0.534, 0.131]]
10
+ )
11
+ sepia_img = image.dot(sepia_filter.T)
12
+ sepia_img /= sepia_img.max()
13
+ return sepia_img
14
+
15
+
16
+ # Write 1 line of Python to create a simple GUI
17
+ gr.Interface(
18
+ fn=sepia,
19
+ inputs="image",
20
+ outputs="image"
21
+ ).launch()