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