Skip to content

Commit

Permalink
lhotse-speech#1203 Update supervision_frame_masks() to skip negative …
Browse files Browse the repository at this point in the history
…end indices

When flipping mask digits to 1.0, negative indices should never be used.
  • Loading branch information
ArthLeu authored Nov 4, 2023
1 parent c5f26af commit 18e0024
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lhotse/cut/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,7 @@ 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
Expand All @@ -2920,6 +2921,7 @@ def compute_supervisions_frame_mask(
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 18e0024

Please sign in to comment.