Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added handlings for negative end time (#1203) #1263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added handlings for negative end time (#1203)
ArthLeu committed Jan 17, 2024
commit e38afec013d94e534fd906e0402760695d3e32af
6 changes: 6 additions & 0 deletions lhotse/cut/set.py
Original file line number Diff line number Diff line change
@@ -2874,15 +2874,21 @@
if ali.end < cut.duration
else num_frames
)
if et <= 0:
continue

Check warning on line 2878 in lhotse/cut/set.py

Codecov / codecov/patch

lhotse/cut/set.py#L2878

Added line #L2878 was not covered by tests
mask[st:et] = 1.0

else:
st = round(supervision.start / frame_shift) if supervision.start > 0 else 0
et = (
round(supervision.end / frame_shift)
if supervision.end < cut.duration
else num_frames
)
if et <= 0:
continue

Check warning on line 2889 in lhotse/cut/set.py

Codecov / codecov/patch

lhotse/cut/set.py#L2889

Added line #L2889 was not covered by tests
mask[st:et] = 1.0

return mask