Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,8 @@ def buffer_n_merge(intervals, buffer=0.1):
|
|
22 |
return new_intervals
|
23 |
|
24 |
|
25 |
-
def download_and_process_video(threshold_db, buffer_sec):
|
26 |
-
vidpath =
|
27 |
|
28 |
# load the video
|
29 |
video = mp.VideoFileClip(vidpath)
|
@@ -52,7 +52,7 @@ def download_and_process_video(threshold_db, buffer_sec):
|
|
52 |
iface = gr.Interface(
|
53 |
fn=download_and_process_video,
|
54 |
inputs=[
|
55 |
-
gr.inputs.File(label="Video File",
|
56 |
gr.inputs.Slider(minimum=1, maximum=70, step=1, default=30, label="Threshold (db)"),
|
57 |
gr.inputs.Slider(minimum=0, maximum=2, step=0.01, default=0.1, label="Buffer (sec)"),
|
58 |
],
|
|
|
22 |
return new_intervals
|
23 |
|
24 |
|
25 |
+
def download_and_process_video(in_f, threshold_db, buffer_sec):
|
26 |
+
vidpath = in_f.name
|
27 |
|
28 |
# load the video
|
29 |
video = mp.VideoFileClip(vidpath)
|
|
|
52 |
iface = gr.Interface(
|
53 |
fn=download_and_process_video,
|
54 |
inputs=[
|
55 |
+
gr.inputs.File(label="Video File", file_types=["mp4"], type='file'),
|
56 |
gr.inputs.Slider(minimum=1, maximum=70, step=1, default=30, label="Threshold (db)"),
|
57 |
gr.inputs.Slider(minimum=0, maximum=2, step=0.01, default=0.1, label="Buffer (sec)"),
|
58 |
],
|