comparison testdata/scripts/matlab/batchProcessingEvaluate.m @ 231:d9b688700819 norm eval-norm-todate

Merge from default branch
author Chris Cannam
date Wed, 16 Jul 2014 17:46:15 +0100
parents 51c18a17404a
children
comparison
equal deleted inserted replaced
215:5ba328aae5be 231:d9b688700819
1 function [Pre,Rec,F] = batchProcessingEvaluate(folder)
2
3 % Evaluate transcription output, using onset-only note-based metrics
4 % e.g. [Pre,Rec,F] = batchProcessingEvaluate('TRIOS-mirex2012-matlab');
5
6
7 fileList = dir(folder);
8 fileCount = 0;
9
10 for i=3:length(fileList)
11
12 if(isdir([folder '/' fileList(i).name]))
13
14 fileCount = fileCount + 1;
15
16
17 % Load ground truth
18 [pianoRollGT,nmatGT] = convertMIDIToPianoRoll([fileList(i).name '.mid'],10,1.0);
19
20
21 % Load transcripton nmat
22 nmat = load([folder '/' fileList(i).name '/' 'mix.lab']);
23
24
25 % Convert 3rd nmat column to MIDI scale
26 nmat(:,3) = round(12.*log2(nmat(:,3)./27.5) + 1);
27
28
29 % Compute onset-based note-level accuracy
30 [Pre(fileCount),Rec(fileCount),F(fileCount)] = computeNoteLevelAccuracy(nmat,nmatGT);
31
32 end;
33 end;