Spaces:
Running
Running
Moibe
commited on
Commit
•
79fbb5a
1
Parent(s):
c0d75d4
Added file as output
Browse files
app.py
CHANGED
@@ -22,6 +22,14 @@ def greet(input1, input2):
|
|
22 |
|
23 |
path_video = input2
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
if plataforma == "local":
|
26 |
#Para local.
|
27 |
path_parts = path_video.split("\\")
|
@@ -106,12 +114,12 @@ def greet(input1, input2):
|
|
106 |
|
107 |
if modo == "video":
|
108 |
#Para video
|
109 |
-
return path,
|
110 |
else:
|
111 |
#Para imagen
|
112 |
path = pathlib.Path("result.png")
|
113 |
print("Éste es el path para imagen:", path)
|
114 |
-
return path,
|
115 |
|
116 |
#Así para imagenes
|
117 |
# demo = gr.Interface(
|
@@ -120,7 +128,7 @@ def greet(input1, input2):
|
|
120 |
|
121 |
#Así para video
|
122 |
demo = gr.Interface(
|
123 |
-
fn=greet, inputs=[gr.Image(), gr.Video()], outputs=[gr.Video(), gr.
|
124 |
)
|
125 |
|
126 |
demo.launch()
|
|
|
22 |
|
23 |
path_video = input2
|
24 |
|
25 |
+
#Mientras tanto voy a crear un archivo de texto genérico.
|
26 |
+
with open("hola.txt", "w") as f:
|
27 |
+
f.write("Hola Mundo")
|
28 |
+
|
29 |
+
path_archivo = pathlib.Path("hola.txt")
|
30 |
+
|
31 |
+
print("El path de mi archivo de texto es: ", path_archivo)
|
32 |
+
|
33 |
if plataforma == "local":
|
34 |
#Para local.
|
35 |
path_parts = path_video.split("\\")
|
|
|
114 |
|
115 |
if modo == "video":
|
116 |
#Para video
|
117 |
+
return path, path_archivo
|
118 |
else:
|
119 |
#Para imagen
|
120 |
path = pathlib.Path("result.png")
|
121 |
print("Éste es el path para imagen:", path)
|
122 |
+
return path, path_foto
|
123 |
|
124 |
#Así para imagenes
|
125 |
# demo = gr.Interface(
|
|
|
128 |
|
129 |
#Así para video
|
130 |
demo = gr.Interface(
|
131 |
+
fn=greet, inputs=[gr.Image(), gr.Video()], outputs=[gr.Video(), gr.File()]
|
132 |
)
|
133 |
|
134 |
demo.launch()
|