annotate testdata/timing/run.sh @ 264:a8928b5bc8a3 norm

Fix script invocation
author Chris Cannam
date Wed, 23 Jul 2014 15:43:46 +0100
parents 603d87049c3c
children 92293058368a
rev   line source
Chris@72 1 #!/bin/sh
Chris@72 2
Chris@72 3 trios_path="/home/cannam/Music/TRIOS_dataset"
Chris@139 4 yc="/home/cannam/code/may/bin/yc"
Chris@72 5
Chris@72 6 if [ ! -d "$trios_path" ]; then
Chris@72 7 echo "TRIOS dataset directory $trios_path not found, giving up"
Chris@72 8 exit 1
Chris@72 9 fi
Chris@72 10
Chris@139 11 if ! "$yc" -v ; then
Chris@139 12 echo "Failed to run Yeti compiler yc at $yc_path, giving up";
Chris@139 13 fi
Chris@139 14
Chris@72 15 if ! sonic-annotator -v ; then
Chris@72 16 echo "Failed to run sonic-annotator (not in PATH?), giving up"
Chris@72 17 exit 1
Chris@72 18 fi
Chris@72 19
Chris@72 20 VAMP_PATH=../..
Chris@72 21 export VAMP_PATH
Chris@72 22
Chris@139 23 outfile="/tmp/$$"
Chris@139 24
Chris@149 25 tmpwav="/tmp/$$norm.wav"
Chris@149 26
Chris@149 27 trap 'rm -f "$outfile" "$tmpwav" "$outfile.lab"' 0
Chris@149 28
Chris@149 29 sox "$trios_path/take_five/mix.wav" "$tmpwav" gain -n -6.020599913279624
Chris@142 30
Chris@72 31 time sonic-annotator \
Chris@72 32 --writer csv \
Chris@139 33 --csv-one-file "$outfile" \
Chris@72 34 --csv-force \
Chris@72 35 --default vamp:silvet:silvet:notes \
Chris@149 36 "$tmpwav"
Chris@72 37
Chris@139 38 cat "$outfile" | \
Chris@139 39 sed 's/^[^,]*,//' | \
Chris@139 40 while IFS=, read start duration frequency level label; do
Chris@139 41 end=`echo "$start $duration + p" | dc`
Chris@139 42 echo -e "$start\t$end\t$frequency"
Chris@139 43 done > "$outfile.lab"
Chris@139 44
Chris@139 45 for ms in 50 100 150; do
Chris@139 46 echo
Chris@139 47 echo "Validating against ground truth at $ms ms:"
Chris@264 48 "$yc" ../scripts/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five/mix.lab" "$outfile.lab"
Chris@139 49 echo
Chris@139 50 echo "Validating against MIREX submission at $ms ms:"
Chris@264 51 "$yc" ../scripts/evaluate_lab.yeti "$ms" "../TRIOS-mirex2012-matlab/take_five/mix.lab" "$outfile.lab"
Chris@141 52 echo
Chris@141 53 echo "Validating MIREX against ground truth at $ms ms":
Chris@264 54 "$yc" ../scripts/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five/mix.lab" "../TRIOS-mirex2012-matlab/take_five/mix.lab"
Chris@139 55 done;
Chris@139 56
Chris@140 57 echo
Chris@140 58