Skip to content

Commit

Permalink
"lhotse-speech#1203 Added handlings for negative end time"
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthLeu committed Jan 17, 2024
1 parent 0089643 commit c74739c
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 c74739c

Please sign in to comment.