File size: 977 Bytes
6766eda
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
set -x
meta_lst=$1
output_dir=$2
dataset_lst=$3
checkpoint_path=wavlm_large_finetune.pth

wav_wav_text=$output_dir/wav_res_ref_text
score_file=$output_dir/wav_res_ref_text.wer

python3 get_wav_res_ref_text.py $meta_lst $output_dir $dataset_lst $wav_wav_text

workdir=$(cd $(dirname $0); pwd)

cd $workdir/thirdparty/UniSpeech/downstreams/speaker_verification/

# 单进程运行
temp_result_file=$output_dir/temp_sim_result.out
python3 verification_pair_list_v2.py $wav_wav_text \
    --model_name wavlm_large \
    --checkpoint $checkpoint_path \
    --scores $temp_result_file \
    --wav1_start_sr 0 \
    --wav2_start_sr 0 \
    --wav1_end_sr -1 \
    --wav2_end_sr -1 \
    --device cuda:0

# 过滤掉 "avg score" 行并计算平均分数
temp_clean_file=$output_dir/temp_sim_clean.out
grep -v "avg score" $temp_result_file > $temp_clean_file
python3 average.py $temp_clean_file $score_file

# 清理临时文件
rm $wav_wav_text
rm $temp_result_file
rm $temp_clean_file