Mercurial > hg > silvet
comparison testdata/evaluation/run-piano.sh @ 267:a8c05709e486
Merge from branch "norm"
author | Chris Cannam |
---|---|
date | Wed, 23 Jul 2014 17:51:58 +0100 |
parents | c9d2809cb86d |
children | 40684b5dd478 |
comparison
equal
deleted
inserted
replaced
250:ec296f783a6f | 267:a8c05709e486 |
---|---|
42 | 42 |
43 transfile="/tmp/$$transform.ttl" | 43 transfile="/tmp/$$transform.ttl" |
44 | 44 |
45 trap 'rm -f "$outfile" "$tmpwav" "$instfile" "$transfile" "$outfile.lab"' 0 | 45 trap 'rm -f "$outfile" "$tmpwav" "$instfile" "$transfile" "$outfile.lab"' 0 |
46 | 46 |
47 infiles=$(find "$piano_path" -name \*.wav) | 47 infiles=$(find "$piano_path" -name \*.wav | sort) |
48 | 48 |
49 echo | 49 echo |
50 echo "Input files are:" | 50 echo "Input files are:" |
51 echo $infiles | fmt -1 | 51 echo $infiles | fmt -1 |
52 | 52 |
63 | 63 |
64 filename=$(basename "$infile" .wav) | 64 filename=$(basename "$infile" .wav) |
65 | 65 |
66 duration=30 | 66 duration=30 |
67 | 67 |
68 for instrument in $intended_instrument 0; do | 68 for instrument in $intended_instrument ; do |
69 | 69 |
70 for norm in no yes; do | 70 for norm in no; do |
71 | 71 |
72 echo | 72 echo |
73 echo "For file $filename, instrument $instrument, norm $norm..." | 73 echo "For file $filename, instrument $instrument, norm $norm..." |
74 | 74 |
75 if [ "$norm" = "no" ]; then | 75 if [ "$norm" = "no" ]; then |
76 # Don't normalise -- part of the point here is to make | 76 # Don't normalise; plugin is now supposed to do it |
77 # it work for various different levels | |
78 sox "$infile" "$tmpwav" trim 0 $duration | 77 sox "$infile" "$tmpwav" trim 0 $duration |
79 else | 78 else |
80 # Normalise as reference | 79 # Normalise as reference |
81 sox "$infile" "$tmpwav" trim 0 $duration gain -n -6.020599913279624 | 80 sox "$infile" "$tmpwav" trim 0 $duration gain -n -6.020599913279624 |
82 fi | 81 fi |
108 fi | 107 fi |
109 fi; | 108 fi; |
110 echo | 109 echo |
111 echo "Validating against ground truth at $ms ms:" | 110 echo "Validating against ground truth at $ms ms:" |
112 egrep '(^[0-9]\.)|(^[012][0-9]\.)' "../piano-groundtruth/$filename.lab" > "$reference.lab" | 111 egrep '(^[0-9]\.)|(^[012][0-9]\.)' "../piano-groundtruth/$filename.lab" > "$reference.lab" |
113 "$yc" ./evaluate_lab.yeti "$ms" "$reference.lab" "$outfile.lab" | sed 's,$,'"$mark"',' | 112 "$yc" ../scripts/evaluate_lab.yeti "$ms" "$reference.lab" "$outfile.lab" | sed 's,$,'"$mark"',' |
114 cp "$reference.lab" /tmp/reference.lab | 113 cp "$reference.lab" /tmp/reference.lab |
115 cp "$outfile.lab" /tmp/detected.lab | 114 cp "$outfile.lab" /tmp/detected.lab |
116 done; | 115 done; |
117 echo | 116 echo |
118 done | 117 done |