Moibe commited on
Commit
30e940b
·
1 Parent(s): a1f2fec

Migración a Blocks

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -169,9 +169,22 @@ def perform(input1, input2, input3):
169
  # demo = gr.Interface(
170
  # fn=greet, inputs=[gr.Image(), gr.Video()], outputs=[gr.Video(), gr.File()]
171
  # )
 
 
 
 
 
 
 
 
 
 
 
172
 
173
  #1 output: video.
174
- demo = gr.Interface(
175
- fn=perform, inputs=[gr.Image(), gr.Video(), gr.CheckboxGroup(["face_swapper","face_enhancer"], label="Processor")], outputs=[gr.Video()]
176
- )
 
 
177
  demo.launch()
 
169
  # demo = gr.Interface(
170
  # fn=greet, inputs=[gr.Image(), gr.Video()], outputs=[gr.Video(), gr.File()]
171
  # )
172
+
173
+ #Haremos lo mismo pero con blocks:
174
+
175
+ with gr.Blocks() as demo:
176
+
177
+ input_imagen_original = gr.Image()
178
+ input_video_destino = gr.Video()
179
+ output_video_resultado = gr.Video()
180
+ btn = gr.Button(value="Submit")
181
+ btn.click(perform, inputs=[input_imagen_original, input_video_destino], outputs=[output_video_resultado])
182
+
183
 
184
  #1 output: video.
185
+ # demo = gr.Interface(
186
+ # fn=perform, inputs=[gr.Image(), gr.Video(), gr.CheckboxGroup(["face_swapper","face_enhancer"], label="Processor")], outputs=[gr.Video()]
187
+ # )
188
+
189
+
190
  demo.launch()