mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
fix: fix corner case with noisy samples only
This commit is contained in:
1 parent
5534a76123
commit
5f9d416dae
1 file changed
+3
@@ -450,6 +450,9 @@ class DBSCANClustering(BaseClustering):
|
||||
)
|
||||
num_clusters = np.max(clusters) + 1
|
||||
|
||||
if num_clusters < 1:
|
||||
return np.zeros((num_embeddings,), dtype=np.uint8)
|
||||
|
||||
# assign noisy samples to closest centroid
|
||||
centroids = np.vstack(
|
||||
[np.mean(embeddings[clusters == k], axis=0) for k in range(num_clusters)]
|
||||
|
||||
Reference in new issue
Block a user