Moibe commited on
Commit
f1a3cbd
1 Parent(s): 5739d02

Compatibility between image and video

Browse files
Files changed (1) hide show
  1. app.py +18 -23
app.py CHANGED
@@ -13,36 +13,31 @@ def greet(input1, input2):
13
  #Para los videos es directo.
14
  #Y al parecer PIL ya lo tiene instalado.
15
 
16
- source_path = "input.jpg"
17
- target_path = "target.jpg"
18
 
19
- source_image = Image.fromarray(input1)
20
- print("Esto es source_image: ", source_image)
21
- source_image.save(source_path)
22
- target_image = Image.fromarray(input2)
23
- print("Esto es target_image: ", target_image)
24
- target_image.save(target_path)
25
 
26
- print("source_path: ", source_path)
27
- print("target_path: ", target_path)
28
 
29
 
30
- return target_path
31
 
32
- #iface = gr.Interface(greet, gr.Video(height=200, width=200), "video")
33
- #gr.show()
34
-
35
- # with gr.Blocks() as demo:
36
- # print("Imprimiendo en Arranque...")
37
- # with gr.Row():
38
- # input1 = gr.Image()
39
- # input2 = gr.Image()
40
- # output = gr.Image()
41
- # btn = gr.Button("Run")
42
- # btn.click(greet, inputs=[gr.Image(), gr.Image()], outputs="image")
43
 
 
44
  demo = gr.Interface(
45
- fn=greet, inputs=[gr.Image(), gr.Image()], outputs="image"
46
  )
47
 
 
48
  demo.launch()
 
13
  #Para los videos es directo.
14
  #Y al parecer PIL ya lo tiene instalado.
15
 
16
+ # source_path = "input.jpg"
17
+ # target_path = "target.jpg"
18
 
19
+ # source_image = Image.fromarray(input1)
20
+ # print("Esto es source_image: ", source_image)
21
+ # source_image.save(source_path)
22
+ # target_image = Image.fromarray(input2)
23
+ # print("Esto es target_image: ", target_image)
24
+ # target_image.save(target_path)
25
 
26
+ # print("source_path: ", source_path)
27
+ # print("target_path: ", target_path)
28
 
29
 
30
+ return input2
31
 
32
+ #Así para imagenes
33
+ # demo = gr.Interface(
34
+ # fn=greet, inputs=[gr.Image(), gr.Image()], outputs="image"
35
+ # )
 
 
 
 
 
 
 
36
 
37
+ #Así para video
38
  demo = gr.Interface(
39
+ fn=greet, inputs=[gr.Video(), gr.Video()], outputs="video"
40
  )
41
 
42
+
43
  demo.launch()