christopherh@1
|
1
|
christopherh@1
|
2
|
christopherh@1
|
3 E_directory = '/media/data/matlab-work/mirex_results/converted';
|
christopherh@1
|
4
|
christopherh@1
|
5 A_directory = '/media/data/beatles chord transcriptions 1.3/';
|
christopherh@1
|
6
|
christopherh@1
|
7 results_dir = '/media/data/matlab-work/mirex_results/recall1'
|
christopherh@1
|
8
|
christopherh@1
|
9
|
christopherh@1
|
10 folders = {'de','ko1','ko2','md','ogf1','ogf2','pp','pvm1','pvm2','rrhs1','rrhs2','rrhs3'};
|
christopherh@1
|
11
|
christopherh@1
|
12 beatles_A_names = readlist('beatles_A_paths.txt');
|
christopherh@1
|
13
|
christopherh@1
|
14 beatles_E_names = readlist('beatles_names.txt');
|
christopherh@1
|
15
|
christopherh@1
|
16 outtext = '';
|
christopherh@1
|
17
|
christopherh@1
|
18 folder_number = length(folders);
|
christopherh@1
|
19 song_number = length(beatles_A_names);
|
christopherh@1
|
20
|
christopherh@1
|
21 paramasarray = [];
|
christopherh@1
|
22
|
christopherh@1
|
23 %tests to run:
|
christopherh@1
|
24
|
christopherh@1
|
25
|
christopherh@1
|
26 % TEST1
|
christopherh@1
|
27
|
christopherh@1
|
28 % set the recall parameters
|
christopherh@1
|
29 params.framerate = 100; %fps 10ms frames
|
christopherh@1
|
30 params.comparison = 'mx08';
|
christopherh@1
|
31 params.cardinality = 3;
|
christopherh@1
|
32 params.inversion = 0;
|
christopherh@1
|
33 params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
|
christopherh@1
|
34
|
christopherh@1
|
35 paramsarray = [paramsarray params];
|
christopherh@1
|
36
|
christopherh@1
|
37
|
christopherh@1
|
38 % TEST2
|
christopherh@1
|
39
|
christopherh@1
|
40 % set the recall parameters
|
christopherh@1
|
41 params.comparison = 'mx09';
|
christopherh@1
|
42 params.cardinality = 3;
|
christopherh@1
|
43 params.inversion = 0;
|
christopherh@1
|
44 params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
|
christopherh@1
|
45
|
christopherh@1
|
46 paramsarray = [paramsarray params];
|
christopherh@1
|
47
|
christopherh@1
|
48 % TEST3
|
christopherh@1
|
49
|
christopherh@1
|
50 % set the recall parameters
|
christopherh@1
|
51 params.comparison = 'op';
|
christopherh@1
|
52 params.cardinality = 3;
|
christopherh@1
|
53 params.inversion = 0;
|
christopherh@1
|
54 params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
|
christopherh@1
|
55
|
christopherh@1
|
56 paramsarray = [paramsarray params];
|
christopherh@1
|
57
|
christopherh@1
|
58 % TEST4
|
christopherh@1
|
59
|
christopherh@1
|
60 % set the recall parameters
|
christopherh@1
|
61 params.comparison = 'op';
|
christopherh@1
|
62 params.cardinality = 2;
|
christopherh@1
|
63 params.inversion = 0;
|
christopherh@1
|
64 params.dictionary = {};% {'N', 'X:maj', 'X:min', 'X:dim', 'X:aug'};
|
christopherh@1
|
65
|
christopherh@1
|
66 paramsarray = [paramsarray params];
|
christopherh@1
|
67
|
christopherh@1
|
68 % TEST5
|
christopherh@1
|
69
|
christopherh@1
|
70 % set the recall parameters
|
christopherh@1
|
71 params.comparison = 'op';
|
christopherh@1
|
72 params.cardinality = 3;
|
christopherh@1
|
73 params.inversion = 0;
|
christopherh@1
|
74 params.dictionary = {'N', 'X:maj', 'X:min'};
|
christopherh@1
|
75
|
christopherh@1
|
76 paramsarray = [paramsarray params];
|
christopherh@1
|
77
|
christopherh@1
|
78
|
christopherh@1
|
79 % TEST6
|
christopherh@1
|
80
|
christopherh@1
|
81 % set the recall parameters
|
christopherh@1
|
82 params.comparison = 'op';
|
christopherh@1
|
83 params.cardinality = 2;
|
christopherh@1
|
84 params.inversion = 0;
|
christopherh@1
|
85 params.dictionary = {'N', 'X:maj', 'X:min'};
|
christopherh@1
|
86
|
christopherh@1
|
87 paramsarray = [paramsarray params];
|
christopherh@1
|
88
|
christopherh@1
|
89
|
christopherh@1
|
90
|
christopherh@1
|
91 for index = 1:numparams
|
christopherh@1
|
92
|
christopherh@1
|
93 params = paramsarray(index);
|
christopherh@1
|
94
|
christopherh@1
|
95 results = zeros(folder_number,song_number,2);
|
christopherh@1
|
96
|
christopherh@1
|
97 time_resolution = 1/params.framerate; % recall time resolution = 1/fps
|
christopherh@1
|
98
|
christopherh@1
|
99 for i = 1:folder_number
|
christopherh@1
|
100
|
christopherh@1
|
101 % for each folder
|
christopherh@1
|
102
|
christopherh@1
|
103
|
christopherh@1
|
104 for j = 1:song_number
|
christopherh@1
|
105
|
christopherh@1
|
106 % get current annotation file
|
christopherh@1
|
107 annotations_labfile = [A_directory '/' beatles_A_names{j}]
|
christopherh@1
|
108
|
christopherh@1
|
109 % get current labfile
|
christopherh@1
|
110 estimates_labfile = [E_directory '/' folders{i} '/' beatles_E_names{j}];
|
christopherh@1
|
111
|
christopherh@1
|
112 % sample at specified frame rate
|
christopherh@1
|
113 % annotation_frames = lab2frames(annotations_labfile, time_resolution);
|
christopherh@1
|
114 % estimate_frames = lab2frames(estimates_labfile, time_resolution);
|
christopherh@1
|
115
|
christopherh@1
|
116 % calculate recall
|
christopherh@1
|
117 % [recall, non_dictionary] = getrecall2(estimate_frames, annotation_frames, params);
|
christopherh@1
|
118
|
christopherh@1
|
119 [recall, non_dictionary] = getrecall3(estimates_labfile, annotations_labfile, params);
|
christopherh@1
|
120
|
christopherh@1
|
121 %[segmeasure, m, f] = getsegmeasure(annotation_labfile, estimates_labfile)
|
christopherh@1
|
122
|
christopherh@1
|
123 results(i,j,1) = recall;
|
christopherh@1
|
124 results(i,j,2) = non_dictionary;
|
christopherh@1
|
125
|
christopherh@1
|
126 end
|
christopherh@1
|
127
|
christopherh@1
|
128
|
christopherh@1
|
129 end
|
christopherh@1
|
130
|
christopherh@1
|
131 outtext = format_recall_results(results, params, folders, beatles_A_names);
|
christopherh@1
|
132
|
christopherh@1
|
133 printfile(outtext, [results_dir '/recall-' datestr(now,'yyyy-mm-dd') '-' params.comparison '.txt']);
|
christopherh@1
|
134
|
christopherh@1
|
135 end
|
christopherh@1
|
136
|