File size: 1,042 Bytes
65f033e
4325a58
 
 
b24d689
65f033e
 
 
 
855b061
2bafee2
855b061
 
fe9e72f
4325a58
65f033e
 
855b061
4325a58
855b061
 
 
4325a58
855b061
 
 
4325a58
855b061
 
4325a58
 
 
 
 
65f033e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import librosa
from model_clap import CLAPEmbedding
from model_meta_voice import MetaVoiceEmbedding
from model_pyannote_embedding import PyannoteEmbedding
from model_speaker_embedding import W2VBERTEmbedding, XLSR300MEmbedding, HuBERTXLEmbedding


def test():
    wav, sr = librosa.load("sample.wav")
    print("XLS-R")
    model = XLSR300MEmbedding()
    v = model.get_speaker_embedding(wav, sr)
    print(v.shape)
    print("CLAP")
    model = CLAPEmbedding()
    v = model.get_speaker_embedding(wav, sr)
    print(v.shape)
    print("MetaVoiceSE")
    model = MetaVoiceEmbedding()
    v = model.get_speaker_embedding(wav, sr)
    print(v.shape)
    print("PyannoteSE")
    model = PyannoteEmbedding()
    v = model.get_speaker_embedding(wav, sr)
    print(v.shape)
    print("W2VBertSE")
    model = W2VBERTEmbedding()
    v = model.get_speaker_embedding(wav, sr)
    print(v.shape)
    print("huBERT")
    model = HuBERTXLEmbedding()
    v = model.get_speaker_embedding(wav, sr)
    print(v.shape)


if __name__ == '__main__':
    test()