# HG changeset patch # User Chris Cannam # Date 1399553442 -3600 # Node ID 32437c1c5ccaaf6eb602591b3dd8ea172d478127 # Parent c0802d1b1fad1573a080eb9c9bb4f2ae82377975 Add evaluation to timing script diff -r c0802d1b1fad -r 32437c1c5cca testdata/timing/run.sh --- a/testdata/timing/run.sh Thu May 08 13:41:13 2014 +0100 +++ b/testdata/timing/run.sh Thu May 08 13:50:42 2014 +0100 @@ -1,12 +1,17 @@ #!/bin/sh trios_path="/home/cannam/Music/TRIOS_dataset" +yc="/home/cannam/code/may/bin/yc" if [ ! -d "$trios_path" ]; then echo "TRIOS dataset directory $trios_path not found, giving up" exit 1 fi +if ! "$yc" -v ; then + echo "Failed to run Yeti compiler yc at $yc_path, giving up"; +fi + if ! sonic-annotator -v ; then echo "Failed to run sonic-annotator (not in PATH?), giving up" exit 1 @@ -15,10 +20,29 @@ VAMP_PATH=../.. export VAMP_PATH +outfile="/tmp/$$" + time sonic-annotator \ --writer csv \ - --csv-one-file /dev/null \ + --csv-one-file "$outfile" \ --csv-force \ --default vamp:silvet:silvet:notes \ "$trios_path/take_five/mix.wav" +cat "$outfile" | \ + sed 's/^[^,]*,//' | \ + while IFS=, read start duration frequency level label; do + end=`echo "$start $duration + p" | dc` + echo -e "$start\t$end\t$frequency" + done > "$outfile.lab" + +for ms in 50 100 150; do + echo + echo "Validating against ground truth at $ms ms:" + "$yc" ../evaluation/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five.lab" "$outfile.lab" + echo + echo "Validating against MIREX submission at $ms ms:" + "$yc" ../evaluation/evaluate_lab.yeti "$ms" "../TRIOS-mirex2012-matlab/take_five/mix.lab" "$outfile.lab" +done; + +rm "$outfile" "$outfile.lab"