Spaces:
Runtime error
Runtime error
Commit
·
861be86
1
Parent(s):
51432f0
initial test
Browse fileshttps://gradio.app/getting_started/
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
|
6 |
+
def sepia(input_img):
|
7 |
+
sepia_filter = np.array(
|
8 |
+
[[0.393, 0.769, 0.189], [0.349, 0.686, 0.168], [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 |
+
|
15 |
+
iface = gr.Interface(sepia, gr.inputs.Image(shape=(200, 200)), "image")
|
16 |
+
|
17 |
+
iface.launch()
|