Spaces:
Sleeping
Sleeping
File size: 488 Bytes
ae93c5f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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() |