mu-ct commited on
Commit
a105bd1
1 Parent(s): 962fb8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -38,7 +38,9 @@ def find_scenes(video_path, threshold):
38
 
39
  timecodes = []
40
  if not scene_list:
41
- raise ValueError("There are no scenes detected in this video.")
 
 
42
  timecodes.append({"title": filename + ".mp4", "fps": scene_list[0][0].get_framerate()})
43
 
44
  shots = []
@@ -148,7 +150,8 @@ with gr.Blocks() as demo:
148
  gr.Markdown("""
149
  # Scene Edit Detection
150
  Copy of @fffiloni's gradio demo of PySceneDetect.
151
- Automatically find all the shots in a video sequence.
 
152
  """)
153
  with gr.Row():
154
  with gr.Column():
@@ -167,4 +170,4 @@ with gr.Blocks() as demo:
167
  run_button.click(fn=find_scenes, inputs=[video_input, threshold], outputs=[json_output, file_output, gallery_output])
168
  clear_button.click(fn=clear_app, inputs = None, outputs=[video_input, threshold, json_output, file_output, gallery_output])
169
 
170
- demo.launch(debug=True)
 
38
 
39
  timecodes = []
40
  if not scene_list:
41
+ gr.Warning("No scenes detected in this video")
42
+ return None, None, None
43
+
44
  timecodes.append({"title": filename + ".mp4", "fps": scene_list[0][0].get_framerate()})
45
 
46
  shots = []
 
150
  gr.Markdown("""
151
  # Scene Edit Detection
152
  Copy of @fffiloni's gradio demo of PySceneDetect.
153
+ Automatically find all the shots in a video.
154
+ Accepts mp4 format. Works only with videos that have cuts in them.
155
  """)
156
  with gr.Row():
157
  with gr.Column():
 
170
  run_button.click(fn=find_scenes, inputs=[video_input, threshold], outputs=[json_output, file_output, gallery_output])
171
  clear_button.click(fn=clear_app, inputs = None, outputs=[video_input, threshold, json_output, file_output, gallery_output])
172
 
173
+ demo.queue().launch(debug=True)