Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import numpy as np | |
| def handler(in1): | |
| sepia_filter=np.array([ | |
| [0.393, 0.769, 0.189], | |
| [0.349, 0.686, 0.168], | |
| [0.272, 0.534, 0.131] | |
| ]) | |
| img=in1.dot(sepia_filter.T) | |
| img /= img.max() | |
| return img | |
| in1=gr.Image(label='上傳圖像') | |
| out1=gr.Image(label='圖像輸出') | |
| iface=gr.Interface( | |
| fn=handler, | |
| inputs=[in1], | |
| outputs=[out1], | |
| title='Image 元件測試', | |
| allow_flagging='never', | |
| ) | |
| iface.launch() |