Skip to content

Commit 7aef36b

Browse files
committed
Handle frame count rounding error
1 parent b68545e commit 7aef36b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

projects/_sp_passiveVideo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ def extract_frame_times(self, save=True, frame_rate=None, display=False, **kwarg
204204
sequence_times += ts[0]
205205
# The below assertion could be caused by an incorrect frame rate or sync sequence
206206
assert sequence_times.size <= sync_sequence.size, 'video duration appears longer than sync sequence'
207+
if len(sequence_times) > n_frames:
208+
# Duration rounding error may lead to 1 frame time too many
209+
sequence_times = sequence_times[:n_frames]
207210
# Keep only the part of the sequence that was shown
208211
x = sync_sequence[:len(sequence_times)]
209212
# Find change points (black <-> white indices)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "project_extraction"
7-
version = "0.8.2"
7+
version = "0.8.3"
88
description = "Custom extractors for satellite tasks"
99
dynamic = [ "readme" ]
1010
keywords = [ "IBL", "neuro-science" ]

0 commit comments

Comments
 (0)