sample image app
Browse files
app.py
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch(share = True)
|
|
|
1 |
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
|
4 |
+
def sepia(input_img):
|
5 |
+
sepia_filter = np.array([[.393, .769, .189],
|
6 |
+
[.349, .686, .168],
|
7 |
+
[.272, .534, .131]])
|
8 |
+
sepia_img = input_img.dot(sepia_filter.T)
|
9 |
+
sepia_img /= sepia_img.max()
|
10 |
+
return sepia_img
|
11 |
+
|
12 |
+
iface = gr.Interface(sepia, gr.inputs.Image(shape=(200, 200)), "image")
|
13 |
|
|
|
14 |
iface.launch(share = True)
|