Skip to content

Commit

Permalink
Update analysis script.
Browse files Browse the repository at this point in the history
Create a performance assessment script.
  • Loading branch information
nathanntg committed Apr 23, 2015
1 parent 76ff37a commit ff66346
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
8 changes: 4 additions & 4 deletions analyze.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
% algorithms to compare
algos = {'rx', 'dwest', 'nswtd', 'mwnswtd', 'pcag'};
algos_nice = {'Global RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG'};
algos = {'rx', 'rxl', 'dwest', 'nswtd', 'mwnswtd', 'pcag', 'mwpcag', 'knna'};
algos_nice = {'Global RX', 'Local RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG', 'MW-PCAG', 'KNN'};

% scenes to compare
scene_files = dir('scenes/*.jpg');
scene_files = {scene_files.name};
% scene_files = {'beach.jpg', 'desert.jpg', 'island.jpg'};

% color spaces to compare
color_spaces = {'RGB', 'L*a*b', 'u''v''L', 'uvL', 'xyY', 'XYZ', '*a*b', 'u''v''', 'uv', 'xy', 'XZ', 'log(L)*a*b'};
color_spaces = {'RGB', 'L*a*b', 'u''v''L', 'uvL', 'xyY', 'XYZ', '*a*b', 'u''v''', 'uv', 'xy', 'XZ', 'log(L)*a*b', 'YCbCr', 'CbCr'};

% make comprehensive target
target = [];
Expand Down Expand Up @@ -62,7 +62,7 @@

% bar plot
b = bar(tbl);
ylim([0.85 1.0]);
ylim([0.65 1.0]);
ylabel('AUC');
xlabel('Color space');
legend(b, algos, 'Location', 'EastOutside');
Expand Down
36 changes: 36 additions & 0 deletions performance.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
% algorithms to performance test
algos = {@RX_global, @rxl, @dwest, @nswtd, @mwnswtd, @pcag, @pcag, @knn};
algos_nice = {'Global RX', 'Local RX', 'DWEST', 'NSWTD', 'MW-NSWTD', 'PCAG', 'MW-PCAG', 'KNN'};

% scenes to compare
scene_files = {'beach.jpg', 'desert.jpg', 'island.jpg'};

% results
tbl = zeros(numel(algos), numel(scene_files));

for i = 1:numel(algos)
cb = algos{i};

for j = 1:numel(scene_files)
% load scene
scene = scene_files{j};
s = load(sprintf('output/%s.mat', scene), 'scene');
img = s.scene;

% profile
t = cputime;
a = cb(img);
e = cputime - t;

% store result
tbl(i, j) = e;
end
end

% bar plot
b = bar(tbl);
ylabel('Time (s)');
xlabel('Algorithm');
set(gca, 'XTickLabel', algos_nice);
title('Execution Time');
print(gcf, 'exec.png', '-dpng', '-r300');

0 comments on commit ff66346

Please sign in to comment.