jordan@6: function make_structure_image(mirid, mirex_truth, mirex_output, mirex_results, mirex_dset_origin) jordan@6: % Quick script to accept an input song number and output an image jordan@6: % of the annotation against the estimated descriptions. jordan@6: jordan@6: % Identify the dataset corresponding to the ID of that song. jordan@6: dset = mirex_dset_origin(mirid); jordan@6: % Provide the index into that dataset of the ID of that song. jordan@6: id_in_dset = mirid + 1 - find(mirex_dset_origin==dset,1); jordan@6: jordan@6: % Assemble all the song descriptions. Start with the annotation, then collect all the algorithm outputs. jordan@6: descs = {}; jordan@6: descs{1} = mirex_truth(mirid); jordan@6: for i=1:9, jordan@6: descs{i+1} = mirex_output(dset).algo(i).song(id_in_dset); jordan@6: end jordan@6: % descs = descs([1 2 3 4 10 5 6 7 8 9]); jordan@6: descorder = [1 2 3 4 6 7 8 9 10 5]; jordan@6: jordan@6: cmap = colormap; jordan@6: jordan@6: gcf; clf, hold on jordan@6: text_extent = max(descs{1}.tim); jordan@6: for i=2:length(descs), jordan@6: text_extent = max([text_extent, max(descs{i}.tim)]); jordan@6: end jordan@6: for i=1:length(descs), jordan@6: s_colors = grp2idx(descs{i}.lab); jordan@6: cmap_rows = round(s_colors*length(cmap)/max(s_colors)); jordan@6: y = descorder(i)*(-1); jordan@6: for n=1:length(descs{i}.tim)-1, jordan@6: pos = [descs{i}.tim(n), y, descs{i}.tim(n+1)-descs{i}.tim(n), 0.8]; jordan@6: cmap_row = cmap(cmap_rows(n),:); jordan@6: rectangle('Position',pos,'FaceColor',cmap_row); jordan@6: end jordan@6: if i>1, jordan@6: pwftmp = mirex_results(dset).algo(i-1).results(id_in_dset,3); jordan@6: text(text_extent + 2,y+.5,num2str(pwftmp,2)) jordan@6: end jordan@6: end jordan@6: axis([0 text_extent+17 -10 0]) jordan@6: s = {'Ground Truth','KSP1','KSP2','KSP3','SP1','MHRAF','OYZS','SBV','SMGA1','SMGA2'}; jordan@6: set(gca,'YTickLabel',fliplr(s),'YTick',(-9.5:-0.5))