forked from MilesICL/vcm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runVCM.sh
executable file
·47 lines (40 loc) · 1.14 KB
/
runVCM.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
#!/bin/bash
# usage introduction
if [ $# -gt 2 ]; then
echo "Usage: runVCM.sh <audiofile> [yunitator_mode]"
exit 1;
fi
# direction of scripts and set path
export PATH=/home/${USER}/anaconda/bin:$PATH
SCRIPT=$(readlink -f $0)
BASEDIR=`dirname $SCRIPT`
cd $BASEDIR
echo $BASEDIR
# check results from Yunitator. If not, run Yunitator first to obtain yunitator_rttm_file
audio_file=$1
if [ $# -gt 1 ]; then
yun=${2}_
else
yun="old_"
fi
bn=$(basename $audio_file)
dn=$(dirname $audio_file)
yunitator_rttm_file=$dn"/yunitator_"${yun}${bn//wav/rttm} # Yunitator output
if [ ! -e $yunitator_rttm_file ]; then
echo "Error: Cannot find SAD outputs in $yunitator_rttm_file. Please run Yunitator first!"
exit 1;
fi
vcm_rttm_file=$dn"/vcm_"${bn//wav/rttm} # vcm output
# # make output folder for features, below input folder
# KEEPTEMP=false
# if [ $BASH_ARGV == "--keep-temp" ]; then
# KEEPTEMP=true
# fi
# VCMTEMP=$dn/VCMtemp
# mkdir -p $VCMTEMP
# do vcm recognition
python2 ./vcm_evaluate.py ${audio_file} ${yunitator_rttm_file} ${vcm_rttm_file}
# # simply remove segmented waves and acoustic features
# if ! $KEEPTEMP; then
# rm -rf $VCMTEMP
# fi