forked from BUTSpeechFIT/VBx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_example.sh
executable file
·65 lines (57 loc) · 2.36 KB
/
run_example.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
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
CDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
mkdir -p exp
for audio in $(ls example/audios/16k)
do
filename=$(echo "${audio}" | cut -f 1 -d '.')
echo ${filename} > exp/list.txt
# run feature and x-vectors extraction
python VBx/predict.py --in-file-list exp/list.txt \
--in-lab-dir example/vad \
--in-wav-dir example/audios/16k \
--out-ark-fn exp/${filename}.ark \
--out-seg-fn exp/${filename}.seg \
--model-file /expscratch/kkarra/xvec_trained_models/wb/resnet_wb_sc0.5.pt \
--embed-dim 128 \
--backend pytorch \
--feat-extraction-engine kaldi \
--xvector-extractor coe \
--kaldi-fbank-conf /expscratch/kkarra/train_egs/fbank_16k.conf
# using COE xvectors
#--model-file /expscratch/amccree/pytorch/v10_gauss_lnorm/adam_768_128_postvox/Test/models/checkpoint-epoch400.pth \
#--embed-dim 128 \
#--backend pytorch \
#--feat-extraction-engine kaldi \
#--kaldi-fbank-conf /expscratch/kkarra/train_egs/fbank_8k.conf
#
# using BUT xvectors
#--weights VBx/models/ResNet101_16kHz/nnet/final.onnx \
#--embed-dim 256 \
#--backend onnx \
# run variational bayes on top of x-vectors
python VBx/vbhmm.py --init GMM \
--out-rttm-dir exp \
--xvec-ark-file exp/${filename}.ark \
--segments-file exp/${filename}.seg \
--threshold -0.015 \
--Fa 0.3 \
--Fb 17 \
--loopP 0.99 \
--N0 30 \
--plda-file /expscratch/kkarra/xvec_trained_models/wb/resnet_wb_sc0.5.pt \
--plda-format pytorch
# using the COE plda
#--plda-file /expscratch/amccree/pytorch/v10_gauss_lnorm/adam_768_128_postvox/Test/models/checkpoint-epoch400.pth \
#--plda-format pytorch
#
# the BUT way
#--lda-dim 128 \
#--xvec-transform VBx/models/ResNet101_16kHz/transform.h5 \
#--plda-file VBx/models/ResNet101_16kHz/plda
# check if there is ground truth .rttm file
if [ -f example/rttm/${filename}.rttm ]
then
# run dscore
python dscore/score.py -r example/rttm/${filename}.rttm -s exp/${filename}.rttm --collar 0.25 --ignore_overlaps
fi
done