forked from aclew/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path537classify.sh
executable file
·48 lines (39 loc) · 1.39 KB
/
537classify.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
#!/bin/bash
# Since the script is built to be launched outside of the vm, source
# the .bashrc which is not necessarily sourced!
source ~/.bashrc
conda_dir=/home/vagrant/anaconda/bin
# run 537 class classifier with hard coded models & configs found here
# assumes Python environment in /home/${user}/anaconda/
# Absolute path to this script. /home/user/bin/foo.sh
SCRIPT=$(readlink -f $0)
# Absolute path this script is in. /home/user/bin
BASEDIR=`dirname $SCRIPT`
# Path to classify tool (go one folder up and to 537cls)
CLASSIFY=$(dirname $BASEDIR)/537cls
if [ $# -ne 1 ]; then
echo "Usage: $0 <dirname>"
echo "where dirname is the name of the folder"
echo "containing the wav files"
exit 1
fi
audio_dir=/vagrant/$1
filename=$(basename "$audio_dir")
dirname=$(dirname "$audio_dir")
extension="${filename##*.}"
basename="${filename%.*}"
# Check audio_dir to see if empty or if contains empty wav
bash $BASEDIR/check_folder.sh $audio_dir
# this is set in user's login .bashrc
#export PATH=/home/${user}/anaconda/bin:$PATH
# let's get our bearings: set CWD to the path of Yunitator
cd $CLASSIFY
# Iterate over files
echo "Starting"
for f in `ls ${audio_dir}/*.wav`; do
./run537classify.sh $f
base=$(basename $f .wav)
mv $audio_dir/${base}.rttm ${audio_dir}/537cls_${base}.rttm
mv $audio_dir/${base}.frame_prob.mat ${audio_dir}/537cls_${base}.frame_prob.mat
done
echo "$0 finished running"