annotate testdata/timing/run.sh @ 372:af71cbdab621 tip

Update bqvec code
author Chris Cannam
date Tue, 19 Nov 2019 10:13:32 +0000
parents 92293058368a
children
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@317 23 tfile=transform.ttl
Chris@317 24
Chris@139 25 outfile="/tmp/$$"
Chris@139 26
Chris@149 27 tmpwav="/tmp/$$norm.wav"
Chris@149 28
Chris@149 29 trap 'rm -f "$outfile" "$tmpwav" "$outfile.lab"' 0
Chris@149 30
Chris@149 31 sox "$trios_path/take_five/mix.wav" "$tmpwav" gain -n -6.020599913279624
Chris@142 32
Chris@72 33 time sonic-annotator \
Chris@72 34 --writer csv \
Chris@139 35 --csv-one-file "$outfile" \
Chris@72 36 --csv-force \
Chris@317 37 --transform "$tfile" \
Chris@149 38 "$tmpwav"
Chris@72 39
Chris@139 40 cat "$outfile" | \
Chris@139 41 sed 's/^[^,]*,//' | \
Chris@139 42 while IFS=, read start duration frequency level label; do
Chris@139 43 end=`echo "$start $duration + p" | dc`
Chris@139 44 echo -e "$start\t$end\t$frequency"
Chris@139 45 done > "$outfile.lab"
Chris@139 46
Chris@139 47 for ms in 50 100 150; do
Chris@139 48 echo
Chris@139 49 echo "Validating against ground truth at $ms ms:"
Chris@264 50 "$yc" ../scripts/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five/mix.lab" "$outfile.lab"
Chris@139 51 echo
Chris@139 52 echo "Validating against MIREX submission at $ms ms:"
Chris@264 53 "$yc" ../scripts/evaluate_lab.yeti "$ms" "../TRIOS-mirex2012-matlab/take_five/mix.lab" "$outfile.lab"
Chris@141 54 echo
Chris@141 55 echo "Validating MIREX against ground truth at $ms ms":
Chris@264 56 "$yc" ../scripts/evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/take_five/mix.lab" "../TRIOS-mirex2012-matlab/take_five/mix.lab"
Chris@139 57 done;
Chris@139 58
Chris@140 59 echo
Chris@140 60