comparison make_structure_image.m @ 6:e2337cd691b1 tip

Finishing writing the matlab code to replicate all observations made in the article. Added the article to the repository. Renamed the two main scripts ("1-get_mirex_estimates.rb" and "2-generate_smith2013_ismir.m") to not have dashes (since this was annoying within Matlab) Added new Michael Jackson figure.
author Jordan Smith <jordan.smith@eecs.qmul.ac.uk>
date Wed, 05 Mar 2014 01:02:26 +0000
parents
children
comparison
equal deleted inserted replaced
5:8d896eec680e 6:e2337cd691b1
1 function make_structure_image(mirid, mirex_truth, mirex_output, mirex_results, mirex_dset_origin)
2 % Quick script to accept an input song number and output an image
3 % of the annotation against the estimated descriptions.
4
5 % Identify the dataset corresponding to the ID of that song.
6 dset = mirex_dset_origin(mirid);
7 % Provide the index into that dataset of the ID of that song.
8 id_in_dset = mirid + 1 - find(mirex_dset_origin==dset,1);
9
10 % Assemble all the song descriptions. Start with the annotation, then collect all the algorithm outputs.
11 descs = {};
12 descs{1} = mirex_truth(mirid);
13 for i=1:9,
14 descs{i+1} = mirex_output(dset).algo(i).song(id_in_dset);
15 end
16 % descs = descs([1 2 3 4 10 5 6 7 8 9]);
17 descorder = [1 2 3 4 6 7 8 9 10 5];
18
19 cmap = colormap;
20
21 gcf; clf, hold on
22 text_extent = max(descs{1}.tim);
23 for i=2:length(descs),
24 text_extent = max([text_extent, max(descs{i}.tim)]);
25 end
26 for i=1:length(descs),
27 s_colors = grp2idx(descs{i}.lab);
28 cmap_rows = round(s_colors*length(cmap)/max(s_colors));
29 y = descorder(i)*(-1);
30 for n=1:length(descs{i}.tim)-1,
31 pos = [descs{i}.tim(n), y, descs{i}.tim(n+1)-descs{i}.tim(n), 0.8];
32 cmap_row = cmap(cmap_rows(n),:);
33 rectangle('Position',pos,'FaceColor',cmap_row);
34 end
35 if i>1,
36 pwftmp = mirex_results(dset).algo(i-1).results(id_in_dset,3);
37 text(text_extent + 2,y+.5,num2str(pwftmp,2))
38 end
39 end
40 axis([0 text_extent+17 -10 0])
41 s = {'Ground Truth','KSP1','KSP2','KSP3','SP1','MHRAF','OYZS','SBV','SMGA1','SMGA2'};
42 set(gca,'YTickLabel',fliplr(s),'YTick',(-9.5:-0.5))