MakiAi commited on
Commit
76e8403
·
verified ·
1 Parent(s): 8dfb48f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -301,5 +301,25 @@ with gr.Blocks(theme=custom_theme, title="Video Frame Extractor (PNG)") as demo:
301
  gallery_first = gr.Gallery(label="全ての最初", columns=3, rows=2, height="auto")
302
  gallery_last = gr.Gallery(label="全ての最後", columns=3, rows=2, height="auto")
303
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  if __name__ == "__main__":
305
  demo.launch()
 
301
  gallery_first = gr.Gallery(label="全ての最初", columns=3, rows=2, height="auto")
302
  gallery_last = gr.Gallery(label="全ての最後", columns=3, rows=2, height="auto")
303
 
304
+ def process(videos):
305
+ first, last, files, zipf, status = extract_frames_from_multiple_videos(videos)
306
+ g_first = create_gallery(videos, is_last=False)
307
+ g_last = create_gallery(videos, is_last=True)
308
+ return first, last, files, zipf, status, g_first, g_last
309
+
310
+ extract_btn.click(
311
+ fn=process,
312
+ inputs=video_input,
313
+ outputs=[
314
+ first_preview,
315
+ last_preview,
316
+ download_files,
317
+ download_zip,
318
+ status_box,
319
+ gallery_first,
320
+ gallery_last,
321
+ ],
322
+ )
323
+
324
  if __name__ == "__main__":
325
  demo.launch()