mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
sond pipeline
This commit is contained in:
parent
fe5c955063
commit
31b4a9837a
@ -26,6 +26,7 @@ def calc_rand_ivc(spk, spk2utt, utt2ivc, utt2frames, total_len=3000):
|
||||
short_spk_list.append(spk)
|
||||
|
||||
ivc_list = [kaldiio.load_mat(utt2ivc[utt]) for utt in utt_list]
|
||||
ivc_list = [x/np.linalg.norm(x, axis=-1) for x in ivc_list]
|
||||
ivc = np.concatenate(ivc_list, axis=0)
|
||||
ivc = np.mean(ivc, axis=0, keepdims=False)
|
||||
return ivc
|
||||
|
||||
@ -103,6 +103,8 @@ def calculate_embedding(spk, spk2utts, utt2xvec, embedding_dim, average_emb_num)
|
||||
xvec_list = [kaldiio.load_mat(utt2xvec[utt]) for utt in utt_list]
|
||||
else:
|
||||
xvec_list = [kaldiio.load_mat(utt2xvec[utt]) for utt in random.sample(utt_list, average_emb_num)]
|
||||
# TODO: rerun the simulation
|
||||
xvec_list = [x / np.linalg.norm(x, axis=-1) for x in xvec_list]
|
||||
xvec = np.mean(np.concatenate(xvec_list, axis=0), axis=0)
|
||||
|
||||
return xvec
|
||||
|
||||
Loading…
Reference in New Issue
Block a user