dpss-exp3-TTS / eval /cal_sim.sh
lglg666's picture
Upload folder using huggingface_hub
6766eda verified
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