# HG changeset patch # User Chris Cannam # Date 1404124713 -3600 # Node ID f742095301a653b0d2ec4d6729b2d5f65bd82081 # Parent 5f4a38f8d9ff207831e29efda1c0e5f91a7eccee# Parent 2b3c6d53c1f19f10f1bcda4cc206f559fc366cf0 Merge from default branch diff -r 5f4a38f8d9ff -r f742095301a6 silvet.n3 --- a/silvet.n3 Wed Jun 04 13:03:56 2014 +0100 +++ b/silvet.n3 Mon Jun 30 11:38:33 2014 +0100 @@ -6,31 +6,53 @@ @prefix dc: . @prefix af: . @prefix foaf: . +@prefix doap: . @prefix cc: . @prefix : <#> . -<> a vamp:PluginDescription ; - foaf:maker ; + +## Properties of this document + +<> a vamp:PluginDescription ; + foaf:maker ; foaf:primaryTopic . -:silvet a vamp:PluginLibrary ; - vamp:identifier "silvet" ; - vamp:available_plugin plugbase:silvet ; - foaf:page ; + +## Maker of the whole plugin library + +:library_maker + foaf:name "Queen Mary, University of London" ; + foaf:logo ; + foaf:page . -plugbase:silvet a vamp:Plugin ; + +## Properties of the plugin library, and references to the plugins it contains + +plugbase:library a vamp:PluginLibrary ; + vamp:identifier "silvet" ; + foaf:maker :library_maker ; + vamp:available_plugin plugbase:silvet ; + dc:title "Silvet Note Transcription" ; # Place library name here and uncomment + dc:description """Silvet, or Shift-Invariant Latent Variable Transcription, is a Vamp plugin for polyphonic music transcription (from audio to note times and pitches).""" ; + foaf:page ; + doap:download-page ; + . + + +## Properties of the Silvet Note Transcription plugin + +plugbase:silvet a vamp:Plugin ; dc:title "Silvet Note Transcription" ; vamp:name "Silvet Note Transcription" ; - dc:description """""" ; - foaf:maker [ foaf:name "Queen Mary, University of London" ] ; # FIXME could give plugin author's URI here + dc:description """Estimate the note onsets, pitches, and durations that make up a music recording.""" ; + foaf:maker :library_maker ; dc:rights """Method by Emmanouil Benetos and Simon Dixon; plugin by Chris Cannam and Emmanouil Benetos. GPL licence.""" ; # cc:license ; vamp:identifier "silvet" ; vamp:vamp_API_version vamp:api_version_2 ; owl:versionInfo "1" ; vamp:input_domain vamp:TimeDomain ; - vamp:parameter plugbase:silvet_param_mode ; vamp:parameter plugbase:silvet_param_instrument ; vamp:parameter plugbase:silvet_param_finetune ; @@ -80,10 +102,7 @@ vamp:bin_count 2 ; vamp:bin_names ( "Frequency" "Velocity"); vamp:sample_type vamp:VariableSampleRate ; - vamp:sample_rate 711.29 ; -# vamp:computes_event_type ; -# vamp:computes_feature ; -# vamp:computes_signal_type ; + vamp:computes_event_type af:Note ; . plugbase:silvet_output_timefreq a vamp:DenseOutput ; vamp:identifier "timefreq" ; @@ -91,9 +110,6 @@ dc:description """Filtered constant-Q time-frequency distribution used as input to the expectation-maximisation algorithm""" ; vamp:fixed_bin_count "true" ; vamp:unit "" ; - vamp:bin_count 545 ; -# vamp:computes_event_type ; -# vamp:computes_feature ; -# vamp:computes_signal_type ; + vamp:computes_signal_type af:Spectrogram ; . diff -r 5f4a38f8d9ff -r f742095301a6 testdata/evaluation/outputs/singleinstrument-d315e946c5fc-default.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testdata/evaluation/outputs/singleinstrument-d315e946c5fc-default.txt Mon Jun 30 11:38:33 2014 +0100 @@ -0,0 +1,188 @@ +Yeti 0.9.9+ +1.0 +make -C constant-q-cpp -f Makefile.linux libcq.a +make[1]: Entering directory '/home/cannam/code/silvet/constant-q-cpp' +make[1]: 'libcq.a' is up to date. +make[1]: Leaving directory '/home/cannam/code/silvet/constant-q-cpp' + +Input files are: +/home/cannam/Music/TRIOS_dataset/lussier/bassoon.wav +/home/cannam/Music/TRIOS_dataset/take_five/saxophone.wav +/home/cannam/Music/TRIOS_dataset/schubert/violin.wav +/home/cannam/Music/TRIOS_dataset/mozart/clarinet.wav + +Evaluating for file /home/cannam/Music/TRIOS_dataset/lussier/bassoon.wav... + +For piece lussier, arrangement bassoon, using instrument 10... + +Validating against ground truth at 50 ms: +precision 64.7, recall 84.6, accuracy 57.8, F 73.3 <-- main lussier/bassoon + +Validating against MIREX submission at 50 ms: +precision 43.5, recall 26.4, accuracy 19.6, F 32.8 + +Validating MIREX against ground truth at 50 ms: +precision 31.4, recall 67.6, accuracy 27.3, F 42.9 + +Validating against ground truth at 100 ms: +precision 67, recall 87.6, accuracy 61.2, F 76 + +Validating against MIREX submission at 100 ms: +precision 63.5, recall 38.5, accuracy 31.5, F 48 + +Validating MIREX against ground truth at 100 ms: +precision 37.1, recall 80, accuracy 33.9, F 50.7 + + +For piece lussier, arrangement bassoon, using instrument 0... + +Validating against ground truth at 50 ms: +precision 40.6, recall 76.9, accuracy 36.2, F 53.1 <-- main lussier/bassoon + +Validating against MIREX submission at 50 ms: +precision 66.6, recall 58.5, accuracy 45.3, F 62.3 + +Validating MIREX against ground truth at 50 ms: +precision 31.4, recall 67.6, accuracy 27.3, F 42.9 + +Validating against ground truth at 100 ms: +precision 40.6, recall 76.9, accuracy 36.2, F 53.1 + +Validating against MIREX submission at 100 ms: +precision 82.1, recall 72.1, accuracy 62.3, F 76.8 + +Validating MIREX against ground truth at 100 ms: +precision 37.1, recall 80, accuracy 33.9, F 50.7 + + +Evaluating for file /home/cannam/Music/TRIOS_dataset/take_five/saxophone.wav... + +For piece take_five, arrangement saxophone, using instrument 0... + +Validating against ground truth at 50 ms: +precision 76.6, recall 90.4, accuracy 70.8, F 82.9 <-- main take_five/saxophone + +Validating against MIREX submission at 50 ms: +precision 75.8, recall 67.1, accuracy 55.2, F 71.2 + +Validating MIREX against ground truth at 50 ms: +precision 67.8, recall 90.4, accuracy 63.3, F 77.5 + +Validating against ground truth at 100 ms: +precision 78.2, recall 92.3, accuracy 73.4, F 84.7 + +Validating against MIREX submission at 100 ms: +precision 89.5, recall 79.2, accuracy 72.5, F 84 + +Validating MIREX against ground truth at 100 ms: +precision 70, recall 93.3, accuracy 66.6, F 80 + + +For piece take_five, arrangement saxophone, using instrument 0... + +Validating against ground truth at 50 ms: +precision 75, recall 88.5, accuracy 68.3, F 81.2 <-- main take_five/saxophone + +Validating against MIREX submission at 50 ms: +precision 75.8, recall 67.1, accuracy 55.2, F 71.2 + +Validating MIREX against ground truth at 50 ms: +precision 67.8, recall 90.4, accuracy 63.3, F 77.5 + +Validating against ground truth at 100 ms: +precision 77.4, recall 91.4, accuracy 72.1, F 83.8 + +Validating against MIREX submission at 100 ms: +precision 88.7, recall 78.5, accuracy 71.4, F 83.3 + +Validating MIREX against ground truth at 100 ms: +precision 70, recall 93.3, accuracy 66.6, F 80 + + +Evaluating for file /home/cannam/Music/TRIOS_dataset/schubert/violin.wav... + +For piece schubert, arrangement violin, using instrument 3... + +Validating against ground truth at 50 ms: +precision 56, recall 80.7, accuracy 49.4, F 66.1 <-- main schubert/violin + +Validating against MIREX submission at 50 ms: +precision 43.9, recall 28.3, accuracy 20.8, F 34.4 + +Validating MIREX against ground truth at 50 ms: +precision 20.4, recall 45.6, accuracy 16.4, F 28.2 + +Validating against ground truth at 100 ms: +precision 62.1, recall 89.4, accuracy 57.9, F 73.3 + +Validating against MIREX submission at 100 ms: +precision 63.4, recall 40.9, accuracy 33.1, F 49.7 + +Validating MIREX against ground truth at 100 ms: +precision 31.4, recall 70.1, accuracy 27.7, F 43.4 + + +For piece schubert, arrangement violin, using instrument 0... + +Validating against ground truth at 50 ms: +precision 30.6, recall 59.6, accuracy 25.3, F 40.4 <-- main schubert/violin + +Validating against MIREX submission at 50 ms: +precision 56.7, recall 49.6, accuracy 36, F 52.9 + +Validating MIREX against ground truth at 50 ms: +precision 20.4, recall 45.6, accuracy 16.4, F 28.2 + +Validating against ground truth at 100 ms: +precision 36.9, recall 71.9, accuracy 32.2, F 48.8 + +Validating against MIREX submission at 100 ms: +precision 78.3, recall 68.5, accuracy 57.6, F 73.1 + +Validating MIREX against ground truth at 100 ms: +precision 31.4, recall 70.1, accuracy 27.7, F 43.4 + + +Evaluating for file /home/cannam/Music/TRIOS_dataset/mozart/clarinet.wav... + +For piece mozart, arrangement clarinet, using instrument 8... + +Validating against ground truth at 50 ms: +precision 89.2, recall 72.4, accuracy 66.6, F 80 <-- main mozart/clarinet + +Validating against MIREX submission at 50 ms: +precision 89.2, recall 69.4, accuracy 64.1, F 78.1 + +Validating MIREX against ground truth at 50 ms: +precision 72.2, recall 75.3, accuracy 58.4, F 73.7 + +Validating against ground truth at 100 ms: +precision 96.4, recall 78.2, accuracy 76, F 86.4 + +Validating against MIREX submission at 100 ms: +precision 98.2, recall 76.3, accuracy 75.3, F 85.9 + +Validating MIREX against ground truth at 100 ms: +precision 75, recall 78.2, accuracy 62, F 76.5 + + +For piece mozart, arrangement clarinet, using instrument 0... + +Validating against ground truth at 50 ms: +precision 81.9, recall 72.4, accuracy 62.5, F 76.9 <-- main mozart/clarinet + +Validating against MIREX submission at 50 ms: +precision 80.3, recall 68, accuracy 58.3, F 73.6 + +Validating MIREX against ground truth at 50 ms: +precision 72.2, recall 75.3, accuracy 58.4, F 73.7 + +Validating against ground truth at 100 ms: +precision 86.8, recall 76.8, accuracy 68.8, F 81.5 + +Validating against MIREX submission at 100 ms: +precision 86.8, recall 73.6, accuracy 66.2, F 79.6 + +Validating MIREX against ground truth at 100 ms: +precision 75, recall 78.2, accuracy 62, F 76.5 + diff -r 5f4a38f8d9ff -r f742095301a6 testdata/evaluation/run-singleinstrumenttest.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testdata/evaluation/run-singleinstrumenttest.sh Mon Jun 30 11:38:33 2014 +0100 @@ -0,0 +1,125 @@ +#!/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 +fi + +rdffile="../../silvet.n3" +if [ ! -f "$rdffile" ] ; then + echo "Failed to find plugin RDF file at $rdffile, giving up" + exit 1 +fi + +case "$trios_path" in +*\ *) echo "TRIOS dataset path $trios_path has a space in it, this script won't handle that"; exit 1;; +esac + +( cd ../.. ; make -f Makefile.linux ) || exit 1 + +VAMP_PATH=../.. +export VAMP_PATH + +outfile="/tmp/$$" + +tmpwav="/tmp/$$norm.wav" + +instfile="/tmp/$$instruments.txt" + +transfile="/tmp/$$transform.ttl" + +trap 'rm -f "$outfile" "$tmpwav" "$instfile" "$transfile" "$outfile.lab"' 0 + +# Use the single-instrument monophonic non-synthetic files for a +# (varied) subset of the TRIOS dataset. We take only those instruments +# for which we have a preset available +infiles="$trios_path/lussier/bassoon.wav $trios_path/take_five/saxophone.wav $trios_path/schubert/violin.wav $trios_path/mozart/clarinet.wav" + +grep Piano "$rdffile" | sed 's/^.*( *//' | sed 's/ *).*$//' | sed 's/ "/\n/g' | sed 's/"//g' | tr '[A-Z]' '[a-z]' | tail -n +2 | cat -n > "$instfile" + +instrument_for() { + filename="$1" + base=`basename "$filename" .wav` + if [ "$base" = "saxophone" ]; then base="tenorsax"; fi + instrument_no=`grep "$base" "$instfile" | awk '{ print $1; }'` + if [ -z "$instrument_no" ] || [ -z "$base" ]; + then echo 0 + else echo "$instrument_no" + fi +} + +echo +echo "Input files are:" +echo $infiles | fmt -1 + +time for infile in $infiles; do + + echo + echo "Evaluating for file $infile..." + + intended_instrument=`instrument_for "$infile"` + case "$intended_instrument" in + [0-9]*) ;; + *) echo "Instrument extraction failed for infile $infile -- not even default multi-instrument setting returned?"; exit 1;; + esac + + piece=`basename \`dirname "$infile" \`` + arrangement=`basename "$infile" .wav` + + # We run this twice, once using the default instrument + # (i.e. "multiple or unknown") and once using the intended + # instrument preset (the solo one). + + for instrument in $intended_instrument 0; do + + echo + echo "For piece $piece, arrangement $arrangement, using instrument $instrument..." + + sox "$infile" "$tmpwav" gain -n -6.020599913279624 + + # generate the transform by interpolating the instrument parameter + cat transform.ttl | sed "s/INSTRUMENT_PARAMETER/$instrument/" > "$transfile" + + sonic-annotator \ + --writer csv \ + --csv-one-file "$outfile" \ + --csv-force \ + --transform "$transfile" \ + "$tmpwav" + + 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; do + mark="" + if [ "$ms" = "50" ]; then mark=" <-- main $piece/$arrangement"; fi; + echo + echo "Validating against ground truth at $ms ms:" + "$yc" ./evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/$piece/$arrangement.lab" "$outfile.lab" | sed 's,$,'"$mark"',' + echo + echo "Validating against MIREX submission at $ms ms:" + "$yc" ./evaluate_lab.yeti "$ms" "../TRIOS-mirex2012-matlab/$piece/$arrangement.lab" "$outfile.lab" + echo + echo "Validating MIREX against ground truth at $ms ms": + "$yc" ./evaluate_lab.yeti "$ms" "../TRIOS-groundtruth/$piece/$arrangement.lab" "../TRIOS-mirex2012-matlab/$piece/$arrangement.lab" + done; + + echo + done +done