Spaces:
Sleeping
Sleeping
Update video_processing.py
Browse files- video_processing.py +2 -2
video_processing.py
CHANGED
@@ -88,12 +88,12 @@ def extract_frames(video, start_time, end_time):
|
|
88 |
end_seconds = convert_timestamp_to_seconds(end_time)
|
89 |
video_clip = video.subclip(start_seconds, end_seconds)
|
90 |
|
91 |
-
for frame_time in range(0, int(video_clip.duration * video_clip.fps), int(video_clip.fps /
|
92 |
frame = video_clip.get_frame(frame_time / video_clip.fps)
|
93 |
frames.append(frame)
|
94 |
return frames
|
95 |
|
96 |
-
def analyze_scenes(video_path, scenes, description, batch_size=
|
97 |
scene_scores = []
|
98 |
negative_descriptions = [
|
99 |
"black screen",
|
|
|
88 |
end_seconds = convert_timestamp_to_seconds(end_time)
|
89 |
video_clip = video.subclip(start_seconds, end_seconds)
|
90 |
|
91 |
+
for frame_time in range(0, int(video_clip.duration * video_clip.fps), int(video_clip.fps / 4)):
|
92 |
frame = video_clip.get_frame(frame_time / video_clip.fps)
|
93 |
frames.append(frame)
|
94 |
return frames
|
95 |
|
96 |
+
def analyze_scenes(video_path, scenes, description, batch_size=20):
|
97 |
scene_scores = []
|
98 |
negative_descriptions = [
|
99 |
"black screen",
|