File size: 1,133 Bytes
1f5f680
f2c9245
1f5f680
5b71a2f
be713a5
5b71a2f
 
f2c9245
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5b71a2f
1f5f680
b1b5fc5
 
06463de
c5d14f6
1d9da87
c5d14f6
fa51f2d
 
 
 
 
 
 
 
06463de
fa51f2d
f2c9245
fa51f2d
d125f21
b1b5fc5
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
37
38
39
40
41
42
43
44
45
import gradio as gr
from PIL import Image

def greet(input1, input2):
    print("Imprimiendo en Consola")
    print("Ésto es input1: ", input1)
    print("Ésto es input2: ", input2)

    #Aquí voy a poner como lo maneja roop en hf.
    #https://huggingface.co/spaces/ezioruan/roop/blob/main/app.py

    source_path = "input.jpg"
    target_path = "target.jpg"

    source_image = Image.fromarray(input1)
    source_image.save(source_path)
    target_image = Image.fromarray(input2)
    target_image.save(target_path)

    print("source_path: ", source_path)
    print("target_path: ", target_path)


    return input1

#def carga_consola():
#    return "Hola Mundo"

#iface = gr.Interface(greet, gr.Video(height=200, width=200), "video")
#gr.show()

# with gr.Blocks() as demo:
#     print("Imprimiendo en Arranque...")
#     with gr.Row():
#         input1 = gr.Image()
#         input2 = gr.Image()
#         output = gr.Image()
#     btn = gr.Button("Run")
#     btn.click(greet, inputs=[gr.Image(), gr.Image()], outputs="image")

demo = gr.Interface(
fn=greet, inputs=[gr.Image(), gr.Image()], outputs="image"
)

demo.launch()