Skip to content

Commit

Permalink
fix: fix clipping issue in speech separation pipeline (#1730)
Browse files Browse the repository at this point in the history
Fixes #1729
  • Loading branch information
joonaskalda authored Oct 8, 2024
1 parent c718d98 commit bd62a89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## develop

### Fixes

- fix: fix clipping issue in speech separation pipeline ([@joonaskalda](https://github.com/joonaskalda/))


## Version 3.3.2 (2024-09-11)

### Fixes
Expand Down
6 changes: 6 additions & 0 deletions pyannote/audio/pipelines/speech_separation.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ def apply(
sources.data * discrete_diarization.align(sources).data[:, :num_sources]
)

# 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
)

# convert to continuous diarization
diarization = self.to_annotation(
discrete_diarization,
Expand Down

0 comments on commit bd62a89

Please sign in to comment.