You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
50 lines
1.3 KiB
#!/bin/bash
|
|
|
|
stage=0
|
|
set=L
|
|
|
|
. ${MAIN_ROOT}/utils/parse_options.sh || exit 1;
|
|
set -u
|
|
set -o pipefail
|
|
|
|
data_folder=$1
|
|
manual_annot_folder=$2
|
|
save_folder=$3
|
|
pretrained_model_dir=$4
|
|
conf_path=$5
|
|
|
|
ref_rttm_dir=${save_folder}/ref_rttms
|
|
meta_data_dir=${save_folder}/metadata
|
|
|
|
if [ ${stage} -le 0 ]; then
|
|
echo "AMI Data preparation"
|
|
python local/ami_prepare.py --data_folder ${data_folder} \
|
|
--manual_annot_folder ${manual_annot_folder} \
|
|
--save_folder ${save_folder} --ref_rttm_dir ${ref_rttm_dir} \
|
|
--meta_data_dir ${meta_data_dir}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "Prepare AMI failed. Please check log message."
|
|
exit 1
|
|
fi
|
|
echo "AMI data preparation done."
|
|
fi
|
|
|
|
if [ ${stage} -le 1 ]; then
|
|
# extra embddings for dev and eval dataset
|
|
for name in dev eval; do
|
|
python local/compute_embdding.py --config ${conf_path} \
|
|
--data-dir ${save_folder} \
|
|
--device gpu:0 \
|
|
--dataset ${name} \
|
|
--load-checkpoint ${pretrained_model_dir}
|
|
done
|
|
fi
|
|
|
|
if [ ${stage} -le 2 ]; then
|
|
# tune hyperparams on dev set
|
|
# perform final diarization on 'dev' and 'eval' with best hyperparams
|
|
python local/experiment.py --config ${conf_path} \
|
|
--data-dir ${save_folder}
|
|
fi
|