Merge branch 'release/3.3.2'

This commit is contained in:
Hervé BREDIN committed 2024-09-11 13:06:31 +02:00
commit 240a7f3ef6
6 files changed
+19 -13

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
# Changelog
## Version 3.3.2 (2024-09-11)
### Fixes
- fix: (really) fix support for `numpy==2.x` ([@metal3d](https://github.com/metal3d/))
- doc: fix `Pipeline` docstring ([@huisman](https://github.com/huisman/))
## Version 3.3.1 (2024-06-19)
+2 -1
View File
@@ -69,7 +69,8 @@ class Pipeline(_Pipeline):
to True or to a string containing your hugginface.co authentication
token that can be obtained by running `huggingface-cli login`
cache_dir: Path or str, optional
Path to model cache directory. Defauorch/pyannote" when unset.
Path to model cache directory. Defaults to content of PYANNOTE_CACHE
environment variable, or "~/.cache/torch/pyannote" when unset.
"""
checkpoint_path = str(checkpoint_path)
@@ -400,7 +400,7 @@ class SpeakerDiarization(SpeakerDiarizationMixin, Pipeline):
num_chunks, num_frames, local_num_speakers = segmentations.data.shape
num_clusters = np.max(hard_clusters) + 1
clustered_segmentations = np.NAN * np.zeros(
clustered_segmentations = np.nan * np.zeros(
(num_chunks, num_frames, num_clusters)
)
@@ -515,7 +515,6 @@ class SpeakerDiarization(SpeakerDiarizationMixin, Pipeline):
centroids = None
else:
# skip speaker embedding extraction with oracle clustering
if self.klustering == "OracleClustering" and not return_embeddings:
embeddings = None
@@ -186,7 +186,7 @@ class NeMoPretrainedSpeakerEmbedding(BaseInference):
# corner case: every signal is too short
if max_len < self.min_num_samples:
return np.NAN * np.zeros((batch_size, self.dimension))
return np.nan * np.zeros((batch_size, self.dimension))
too_short = wav_lens < self.min_num_samples
wav_lens[too_short] = max_len
@@ -197,7 +197,7 @@ class NeMoPretrainedSpeakerEmbedding(BaseInference):
)
embeddings = embeddings.cpu().numpy()
embeddings[too_short.cpu().numpy()] = np.NAN
embeddings[too_short.cpu().numpy()] = np.nan
return embeddings
@@ -364,7 +364,7 @@ class SpeechBrainPretrainedSpeakerEmbedding(BaseInference):
# corner case: every signal is too short
if max_len < self.min_num_samples:
return np.NAN * np.zeros((batch_size, self.dimension))
return np.nan * np.zeros((batch_size, self.dimension))
too_short = wav_lens < self.min_num_samples
wav_lens = wav_lens / max_len
@@ -377,7 +377,7 @@ class SpeechBrainPretrainedSpeakerEmbedding(BaseInference):
.numpy()
)
embeddings[too_short.cpu().numpy()] = np.NAN
embeddings[too_short.cpu().numpy()] = np.nan
return embeddings
@@ -594,7 +594,7 @@ class ONNXWeSpeakerPretrainedSpeakerEmbedding(BaseInference):
imasks = imasks > 0.5
embeddings = np.NAN * np.zeros((batch_size, self.dimension))
embeddings = np.nan * np.zeros((batch_size, self.dimension))
for f, (feature, imask) in enumerate(zip(features, imasks)):
masked_feature = feature[imask]
@@ -419,7 +419,7 @@ class SpeechSeparation(SpeakerDiarizationMixin, Pipeline):
num_chunks, num_frames, local_num_speakers = segmentations.data.shape
num_clusters = np.max(hard_clusters) + 1
clustered_segmentations = np.NAN * np.zeros(
clustered_segmentations = np.nan * np.zeros(
(num_chunks, num_frames, num_clusters)
)
@@ -644,9 +644,9 @@ class SpeechSeparation(SpeakerDiarizationMixin, Pipeline):
len(speaker_activation), dtype=float
)
speaker_activation_with_context[
np.concatenate(remaining_zeros)
] = 0.0
speaker_activation_with_context[np.concatenate(remaining_zeros)] = (
0.0
)
discrete_diarization.data.T[i] = speaker_activation_with_context
num_sources = sources.data.shape[1]
+1 -1
View File
@@ -1 +1 @@
3.3.1
3.3.2