-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMI_run.sh
executable file
·34 lines (30 loc) · 1.03 KB
/
AMI_run.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
#!/usr/bin/env bash
stage=0
AMIcorpus=example/ami/amicorpus # If you already have amicorpus, please set the path to that location and skip stage 0.
oracle_rttm_path=example/ami/rttm
testset_path=example/ami/ami_testset
if [ $stage -le 0 ]; then
echo "Stage 0: Download ami test corpus."
./example/ami/amitestBuild.wget.sh
AMIcorpus=example/ami/amicorpus
fi
if [ $stage -le 1 ]; then
echo "Stage 1: Preparing data."
mkdir -p $testset_path
rm $testset_path/*
for audio_path in $(find $AMIcorpus/*/audio -name *.wav)
do
audio_name=`basename $audio_path`
new_audio_name=$(basename "$audio_name" .Mix-Headset.wav).wav
for test_name in $(cat example/ami/ami_testset_list.txt)
do
if [ $audio_name == $test_name ]; then
ln -s `pwd`/$audio_path $testset_path/$new_audio_name
fi
done
done
fi
if [ $stage -le 2 ]; then
echo "Stage 2: Analyzing ami test corpus."
python3 RTTManz.py --rttm_path $oracle_rttm_path --audio_path $testset_path
fi