Skip to content

Commit

Permalink
Added handlings for negative end time (lhotse-speech#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthLeu committed Jan 17, 2024
1 parent 0089643 commit e38afec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lhotse/cut/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -2874,15 +2874,21 @@ def compute_supervisions_frame_mask(
if ali.end < cut.duration
else num_frames
)
if et <= 0:
continue
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
mask[st:et] = 1.0

return mask


Expand Down

0 comments on commit e38afec

Please sign in to comment.