Spaces:
Sleeping
Sleeping
added threshold slider
Browse files
app.py
CHANGED
@@ -17,7 +17,8 @@ description = "Gradio demo of PyScene scenedetect, to automatically find every s
|
|
17 |
# —————————————————————————————————————————————————
|
18 |
|
19 |
# SET INPUTS
|
20 |
-
video_input = gr.Video(source="upload", format="mp4", label="Video Sequence", mirror_webcam=False)
|
|
|
21 |
|
22 |
# —————————————————————————————————————————————————
|
23 |
|
@@ -25,7 +26,7 @@ def convert_to_tuple(list):
|
|
25 |
return tuple(list);
|
26 |
|
27 |
|
28 |
-
def find_scenes(video_path, threshold
|
29 |
# file name without extension
|
30 |
filename = os.path.splitext(os.path.basename(video_path))[0]
|
31 |
# Open our video, create a scene manager, and add a detector.
|
@@ -149,4 +150,4 @@ outputs = [gr.JSON(label="Shots detected"), gr.File(label="Downloadable Shots"),
|
|
149 |
|
150 |
# —————————————————————————————————————————————————
|
151 |
print('Hello Sylvain')
|
152 |
-
gr.Interface(fn=find_scenes, inputs=video_input, outputs=outputs, title=title, description=description).launch()
|
|
|
17 |
# —————————————————————————————————————————————————
|
18 |
|
19 |
# SET INPUTS
|
20 |
+
video_input = gr.Video(source="upload", format="mp4", label="Video Sequence", mirror_webcam=False)
|
21 |
+
threshold = gr.Slider(minimum=5.0, maximum=50.0, value=27.0)
|
22 |
|
23 |
# —————————————————————————————————————————————————
|
24 |
|
|
|
26 |
return tuple(list);
|
27 |
|
28 |
|
29 |
+
def find_scenes(video_path, threshold):
|
30 |
# file name without extension
|
31 |
filename = os.path.splitext(os.path.basename(video_path))[0]
|
32 |
# Open our video, create a scene manager, and add a detector.
|
|
|
150 |
|
151 |
# —————————————————————————————————————————————————
|
152 |
print('Hello Sylvain')
|
153 |
+
gr.Interface(fn=find_scenes, inputs=[video_input, threshold], outputs=outputs, title=title, description=description).launch()
|