Skip to content

Commit

Permalink
fix(separation): fix division by zero in separation pipeline corner c…
Browse files Browse the repository at this point in the history
…ases (#1815)
  • Loading branch information
clement-pages authored Feb 4, 2025
1 parent 43bb258 commit d6136a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyannote/audio/pipelines/speech_separation.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,8 @@ def apply(

# separated sources might be scaled up/down due to SI-SDR loss used when training
# so we peak-normalize them
sources.data = sources.data / np.max(
np.abs(sources.data), axis=0, keepdims=True
sources.data = (
sources.data / (np.max(np.abs(sources.data), axis=0, keepdims=True) + 1e-8)
)

# convert to continuous diarization
Expand Down

0 comments on commit d6136a8

Please sign in to comment.