tomaseo2022 commited on
Commit
6793ee4
1 Parent(s): f9c8dbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -22
app.py CHANGED
@@ -2,30 +2,17 @@ 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], [0.349, 0.686, 0.168], [0.272, 0.534, 0.131]]
7
- )
8
- sepia_img = input_img.dot(sepia_filter.T)
9
- sepia_img /= sepia_img.max()
10
- return sepia_img
11
 
12
  iface = gr.Interface(
13
- sepia,
14
- gr.components.Image(),
15
- "image",
16
- title="Convertidor de imagen a sepia",
17
- description="Sube una imagen y conviértela a sepia.",
18
- css=".footer{display:none !important}",
19
- inputs=[
20
- gr.components.Image(label="Imagen de entrada")
21
- ],
22
- outputs=[
23
- gr.components.Image(label="Imagen sepia")
24
- ],
25
- examples=[
26
- ["https://live.staticflickr.com/65535/51275594794_b6163c1ea6_z.jpg"]
27
- ],
28
- theme="compact",
29
  button_labels=["Limpiar", "Convertir a sepia"]
30
  )
31
  iface.launch()
@@ -33,3 +20,7 @@ iface.launch()
33
 
34
 
35
 
 
 
 
 
 
2
  import gradio as gr
3
 
4
  def sepia(input_img):
5
+ sepia_filter = np.array(
6
+ [[0.393, 0.769, 0.189], [0.349, 0.686, 0.168], [0.272, 0.534, 0.131]]
7
+ )
8
+ sepia_img = input_img.dot(sepia_filter.T)
9
+ sepia_img /= sepia_img.max()
10
+ return sepia_img
11
 
12
  iface = gr.Interface(
13
+ sepia,
14
+ gr.components.Image(), "image",
15
+ css=".footer{display:none !important}",
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  button_labels=["Limpiar", "Convertir a sepia"]
17
  )
18
  iface.launch()
 
20
 
21
 
22
 
23
+
24
+
25
+
26
+