-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_accuracy_box.m
68 lines (59 loc) · 2.66 KB
/
plot_accuracy_box.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% This function is part of the GlobalPointer method as described in [1]. When you
% use this code, you are required to cite [1].
%
% [1] GlobalPointer: Large-Scale Plane Adjustment with Bi-Convex Relaxation
% Author: B. Liao, Z. Zhao, L. Chen, H. Li, D. Cremers, P. Liu.
% European Conference on Computer Vision 2024 (ECCV 2024)
%
%
% Author & Copyright (C) 2024: Bangyan Liao (liaobangyan[at]westlake[dot]edu[dot]cn)
% Zhenjun Zhao (ericzzj89[at]gmail[dot]com)
% Peidong Liu (liupeidong[at]westlake[dot]edu[dot]cn)
function plot_accuracy_box(results, method_list, plot_list, x_axis_list, title_list, is_log10, y_axis_title, x_axis_title)
epoch_size_num = size(results{1, 1}.error, 1);
iteration_size_num = size(results{1, 1}.error, 2);
error_name = fieldnames(results{1, 1}.error{1, 1});
error_size_num = size(error_name, 1);
method_size_num = size(plot_list, 2);
error_size_num = 5;
for error_i = 1:error_size_num
x_list = [];
y_list = [];
label_list = [];
for plot_i = 1:method_size_num
x_tmp_list = [];
y_tmp_list = [];
plot_method = plot_list(1, plot_i);
method_id = find(method_list == plot_method);
error_all = results{method_id, 1}.error;
for epoch_i = 1:epoch_size_num
error_single = [];
for iteration_i = 1:iteration_size_num
if ~isempty(error_all{epoch_i, iteration_i})
error_struct = error_all{epoch_i, iteration_i};
error_cell = struct2cell(error_struct);
error_cell = error_cell{error_i, 1};
error_single = [error_single;error_cell(1, end)];
end
end
if is_log10
y_tmp_list = [y_tmp_list; log10(error_single)];
else
y_tmp_list = [y_tmp_list; (error_single)];
end
x_tmp_list = [x_tmp_list; repmat(x_axis_list(1, epoch_i), size(error_single))];
end
x_list = [x_list; x_tmp_list];
y_list = [y_list; y_tmp_list];
label_list = [label_list;repmat(plot_method, size(x_tmp_list))];
end
x_list = categorical(x_list, x_axis_list);
figure
boxchart(x_list,y_list, 'GroupByColor', label_list);
title(title_list(1, error_i));
xlabel(x_axis_title);
ylabel(y_axis_title);
legend;
set(gcf, 'color', 'w');
end
end