zhaomingwork
2023-05-13 f2e7ea83c9d8b580d09eb31acf6c2fa60e683e3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
import sys
 
# Define extraction pipeline
inference_sv_pipline = pipeline(
    task=Tasks.speaker_verification,
    model='damo/speech_xvector_sv-zh-cn-cnceleb-16k-spk3465-pytorch',
    output_dir=sys.argv[2],
)
# Extract speaker embedding
rec_result = inference_sv_pipline(
    audio_in=sys.argv[1],
 
)