Spaces:
Runtime error
Runtime error
File size: 833 Bytes
bc22a86 82c4d4c 5c0419e 82c4d4c 5c0419e 82c4d4c 5c0419e 82c4d4c 26dc8e1 9abd07c 82c4d4c 5c0419e f9c8dbf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import numpy as np
import gradio as gr
def sepia(input_img):
sepia_filter = np.array(
[[0.393, 0.769, 0.189], [0.349, 0.686, 0.168], [0.272, 0.534, 0.131]]
)
sepia_img = input_img.dot(sepia_filter.T)
sepia_img /= sepia_img.max()
return sepia_img
iface = gr.Interface(
sepia,
gr.components.Image(),
"image",
title="Convertidor de imagen a sepia",
description="Sube una imagen y conviértela a sepia.",
css=".footer{display:none !important}",
inputs=[
gr.components.Image(label="Imagen de entrada")
],
outputs=[
gr.components.Image(label="Imagen sepia")
],
examples=[
["https://live.staticflickr.com/65535/51275594794_b6163c1ea6_z.jpg"]
],
theme="compact",
button_labels=["Limpiar", "Convertir a sepia"]
)
iface.launch()
|