forked from BUTSpeechFIT/VBx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_rt09.sh
executable file
·57 lines (51 loc) · 2.09 KB
/
run_rt09.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
export KALDI_ROOT='/home/liaozty20/kaldi'
CDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
mkdir -p rt09_exp
mkdir -p result
for audio in $(ls /home/liaozty20/rt09/wav/16k)
do
filename=$(echo "${audio}" | cut -f 1 -d '.')
echo ${filename} > rt09_exp/list.txt
echo "X-vectors Extraction Starts: "${filename}""
# run feature and x-vectors extraction
python VBx/predict.py --in-file-list rt09_exp/list.txt \
--in-lab-dir /home/liaozty20/rt09/labs \
--in-wav-dir /home/liaozty20/rt09/wav/16k \
--out-ark-fn rt09_exp/${filename}.ark \
--out-seg-fn rt09_exp/${filename}.seg \
--backend pytorch \
--weights VBx/models/ResNet101_16kHz/nnet/raw_81.pth \
--model ResNet101 \
--gpus $(VBx/free_gpu.sh)
echo "X-vectors Extraction Ends: "${filename}""
echo "VB-HMM Starts: "${filename}""
# run variational bayes on top of x-vectors
python VBx/vbhmm.py --init AHC+VB \
--out-rttm-dir rt09_exp \
--xvec-ark-file rt09_exp/${filename}.ark \
--segments-file rt09_exp/${filename}.seg \
--xvec-transform VBx/models/ResNet101_16kHz/transform.h5 \
--plda-file VBx/models/ResNet101_16kHz/plda \
--threshold -0.015 \
--lda-dim 128 \
--Fa 0.3 \
--Fb 17 \
--loopP 0.99
echo "VB-HMM Ends: "${filename}""
echo "Scoring Starts: "${filename}""
# check if there is ground truth .rttm file
REFDIR=/home/liaozty20/rt09/rttm/${filename}.rttm
SYSDIR=rt09_exp/${filename}.rttm
# if [ -f /home/liaozty20/AMI\-diarization\-setup/only_words/rttms/test/${filename}.rttm ]
# then
# # run dscore
# # forgiving
# python dscore/score.py -r $REFDIR -s $SYSDIR --collar 0.25 --ignore_overlaps
# # fair
# python dscore/score.py -r $REFDIR -s $SYSDIR --collar 0.25
# # full
# python dscore/score.py -r $REFDIR -s $SYSDIR --collar 0.0
# fi
echo "Scoring Ends: "${filename}""
done