annotate testdata/scripts/matlab/batchProcessingEvaluate.m @ 372:af71cbdab621 tip

Update bqvec code
author Chris Cannam
date Tue, 19 Nov 2019 10:13:32 +0000
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;