annotate testdata/scripts/matlab/batchProcessingEvaluate.m @ 325:4cf4313d7e30
livemode
Always use q=0.8 and accept the hit on speed -- the templates are made for that configuration and it does work better. Also some adjustments to thresholding and peak picking for live mode in particular.
author |
Chris Cannam |
date |
Mon, 18 May 2015 13:58:27 +0100 |
parents |
51c18a17404a |
children |
|
rev |
line source |
emmanouil@71
|
1 function [Pre,Rec,F] = batchProcessingEvaluate(folder)
|
emmanouil@71
|
2
|
emmanouil@71
|
3 % Evaluate transcription output, using onset-only note-based metrics
|
emmanouil@71
|
4 % e.g. [Pre,Rec,F] = batchProcessingEvaluate('TRIOS-mirex2012-matlab');
|
emmanouil@71
|
5
|
emmanouil@71
|
6
|
emmanouil@71
|
7 fileList = dir(folder);
|
emmanouil@71
|
8 fileCount = 0;
|
emmanouil@71
|
9
|
emmanouil@71
|
10 for i=3:length(fileList)
|
emmanouil@71
|
11
|
emmanouil@71
|
12 if(isdir([folder '/' fileList(i).name]))
|
emmanouil@71
|
13
|
emmanouil@71
|
14 fileCount = fileCount + 1;
|
emmanouil@71
|
15
|
emmanouil@71
|
16
|
emmanouil@71
|
17 % Load ground truth
|
emmanouil@71
|
18 [pianoRollGT,nmatGT] = convertMIDIToPianoRoll([fileList(i).name '.mid'],10,1.0);
|
emmanouil@71
|
19
|
emmanouil@71
|
20
|
emmanouil@71
|
21 % Load transcripton nmat
|
emmanouil@71
|
22 nmat = load([folder '/' fileList(i).name '/' 'mix.lab']);
|
emmanouil@71
|
23
|
emmanouil@71
|
24
|
emmanouil@71
|
25 % Convert 3rd nmat column to MIDI scale
|
emmanouil@71
|
26 nmat(:,3) = round(12.*log2(nmat(:,3)./27.5) + 1);
|
emmanouil@71
|
27
|
emmanouil@71
|
28
|
emmanouil@71
|
29 % Compute onset-based note-level accuracy
|
emmanouil@71
|
30 [Pre(fileCount),Rec(fileCount),F(fileCount)] = computeNoteLevelAccuracy(nmat,nmatGT);
|
emmanouil@71
|
31
|
emmanouil@71
|
32 end;
|
emmanouil@71
|
33 end; |