annotate testdata/timing/run.sh @ 141:21efe7d37c4c

Print MIREX-groundtruth evaluation as well for reference
author Chris Cannam
date Thu, 08 May 2014 13:54:08 +0100
parents 7d28385784cc
children 03fbd6a204fd
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@72 25 time sonic-annotator \
Chris@72 26 --writer csv \
Chris@139 27 --csv-one-file "$outfile" \
Chris@72 28 --csv-force \
Chris@72 29 --default vamp:silvet:silvet:notes \
Chris@72 30 "$trios_path/take_five/mix.wav"
Chris@72 31
Chris@139 32 cat "$outfile" | \
Chris@139 33 sed 's/^[^,]*,//' | \
Chris@139 34 while IFS=, read start duration frequency level label; do
Chris@139 35 end=`echo "$start $duration + p" | dc`
Chris@139 36 echo -e "$start\t$end\t$frequency"
Chris@139 37 done > "$outfile.lab"
Chris@139 38
Chris@139 39 for ms in 50 100 150; do
Chris@139 40 echo
Chris@139 41 echo "Validating against ground truth at $ms ms:"
Chris@139 42 "$yc" ../evaluation/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five.lab" "$outfile.lab"
Chris@139 43 echo
Chris@139 44 echo "Validating against MIREX submission at $ms ms:"
Chris@139 45 "$yc" ../evaluation/evaluate_lab.yeti "$ms" "../TRIOS-mirex2012-matlab/take_five/mix.lab" "$outfile.lab"
Chris@141 46 echo
Chris@141 47 echo "Validating MIREX against ground truth at $ms ms":
Chris@141 48 "$yc" ../evaluation/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five.lab" "../TRIOS-mirex2012-matlab/take_five/mix.lab"
Chris@139 49 done;
Chris@139 50
Chris@140 51 echo
Chris@140 52
Chris@139 53 rm "$outfile" "$outfile.lab"