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