wildoctopus commited on
Commit
84e526f
·
verified ·
1 Parent(s): a58c851

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -14
app.py CHANGED
@@ -1,17 +1,16 @@
 
1
  import gradio as gr
2
 
3
- with gr.Blocks() as demo:
4
- gr.Markdown("# Image Display Demo")
5
- with gr.Row():
6
- with gr.Column():
7
- img_input = gr.Image(type="pil", label="Upload Image")
8
- with gr.Column():
9
- img_output = gr.Image(label="Output Image")
10
-
11
- img_input.change(
12
- fn=lambda x: x,
13
- inputs=img_input,
14
- outputs=img_output
15
- )
16
 
17
- demo.launch()
 
 
 
1
+ import numpy as np
2
  import gradio as gr
3
 
4
+ def sepia(input_img):
5
+ sepia_filter = np.array([
6
+ [0.393, 0.769, 0.189],
7
+ [0.349, 0.686, 0.168],
8
+ [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
+ demo = gr.Interface(sepia, gr.Image(), "image")
15
+ if __name__ == "__main__":
16
+ demo.launch()