From b32b21d9c8b0ea659711760e7c80fb572d6b7a41 Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期二, 19 三月 2024 16:28:54 +0800
Subject: [PATCH] for h5 missing some result (#1514)
---
funasr/models/campplus/cluster_backend.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/funasr/models/campplus/cluster_backend.py b/funasr/models/campplus/cluster_backend.py
index 3bac0a0..72d06da 100644
--- a/funasr/models/campplus/cluster_backend.py
+++ b/funasr/models/campplus/cluster_backend.py
@@ -4,7 +4,6 @@
# MIT License (https://opensource.org/licenses/MIT)
# Modified from 3D-Speaker (https://github.com/alibaba-damo-academy/3D-Speaker)
-import umap
import scipy
import torch
import sklearn
@@ -119,6 +118,7 @@
self.metric = metric
def __call__(self, X):
+ import umap.umap_ as umap
umap_X = umap.UMAP(
n_neighbors=self.n_neighbors,
min_dist=0.0,
@@ -156,6 +156,7 @@
if X.shape[0] < 20:
return np.zeros(X.shape[0], dtype='int')
if X.shape[0] < 2048 or k is not None:
+ # unexpected corner case
labels = self.spectral_cluster(X, k)
else:
labels = self.umap_hdbscan_cluster(X)
--
Gitblit v1.9.1