tracking里面的性能图怎么画,类似ocean论文中的

原博客地址:https://blog.csdn.net/laizi_laizi/article/details/120935429
直接在pycharm里面就能运行

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.axes._axes as axes
import matplotlib.figure as figure
from matplotlib.backends.backend_pdf import PdfPages
pdf = PdfPages('speed-eao2018.pdf')
plt.rc('font',family='Times New Roman')

fig, ax = plt.subplots()  # type:figure.Figure, axes.Axes
ax.set_title('The Performance $vs.$ Speed on VOT-2018', fontsize=15)
ax.set_xlabel('Tracking Speed (FPS)', fontsize=15)
ax.set_ylabel('EAO', fontsize=15)


trackers = ['C-RPN', 'SiamVGG', 'DaSiamRPN', 'ATOM', 'SiamRPN++', 'DiMP', 'Ours (offline-2)', 'Ours (offline-1)', 'Ours (online)']
speed = np.array([50, 75, 65, 35, 50, 45, 72, 58, 25])
speed_norm = np.array([50, 75, 65, 35, 50, 45, 72, 58, 25]) / 48
performance = np.array([0.273, 0.286, 0.380, 0.401, 0.414, 0.440, 0.438, 0.467, 0.490])

circle_color = ['cornflowerblue', 'deepskyblue',  'turquoise', 'gold', 'yellowgreen', 'orange', 'r', 'r', 'r']
# Marker size in units of points^2
volume = (300 * speed_norm/5 * performance/0.6)  ** 2

ax.scatter(speed, performance, c=circle_color, s=volume, alpha=0.4)
ax.scatter(speed, performance, c=circle_color, s=20, marker='o')
# text
ax.text(speed[0] - 2.37, performance[0] - 0.031, trackers[0], fontsize=10, color='k')
ax.text(speed[1] - 11.00, performance[1] - 0.005, trackers[1], fontsize=10, color='k')
ax.text(speed[2] - 3.5, performance[2] - 0.05, trackers[2], fontsize=10, color='k')
ax.text(speed[3] - 2.4, performance[3] - 0.032, trackers[3], fontsize=10, color='k')
ax.text(speed[4] - 2.9, performance[4] - 0.040, trackers[4], fontsize=10, color='k')
ax.text(speed[5] - 1.8, performance[5] - 0.042, trackers[5], fontsize=10, color='k')
ax.text(speed[6] - 6.0, performance[6] + 0.051, trackers[6], fontsize=14, color='k')
ax.text(speed[7] - 4.5, performance[7] -0.050, trackers[7], fontsize=12, color='k')
ax.text(speed[8] - 4, performance[8] -0.035, trackers[8], fontsize=12, color='k')

ax.grid(which='major', axis='both', linestyle='-.') # color='r', linestyle='-', linewidth=2
ax.set_xlim(20, 80)
ax.set_ylim(0.20, 0.53)
ax.xaxis.set_tick_params(labelsize=15)
ax.yaxis.set_tick_params(labelsize=15)

# plot lines
ystart, yend = ax.get_ylim()
ax.plot([25, 25], [ystart, yend], linestyle="--", color='k', linewidth=0.7)
ax.plot([25, 58], [0.490,  0.467], linestyle="--", color='r', linewidth=0.7)
ax.plot([58, 72], [0.467, 0.438], linestyle="--", color='r', linewidth=0.7)
ax.text(26, 0.230, 'Real-time line', fontsize=11, color='k')

fig.savefig('speed-eao2018.svg')


pdf.savefig()
pdf.close()
plt.show()

效果图
在这里插入图片描述
MATLAB代码

clear; close all; clc;
load('../data/attr_eao_vot2016.mat');

tracker_names = fieldnames(result);
legend_names = fieldnames(result.(tracker_names{1}));
num_tracker = length(tracker_names);
num_attr = length(legend_names);
eao = zeros(num_tracker,num_attr);
for i = 1:num_tracker
    for j = 1:num_attr
        eao(i,j) = result.(tracker_names{i}).(legend_names{j});
    end
end
[eao_sorted,sorted_index] = sort(eao(:,1),'descend'); % rank by baseline eao
tracker_names = tracker_names(sorted_index);

figure;
Maker_style = {'o','x','*','v','diamond','+','<','pentagram','>','square','^','hexagram'};
Color_style = hsv(7);
line([0,num_tracker],[0.255,0.255],'LineWidth',2,'Color',[0.7 0.7 0.7]); hold on;
recent_index = [1,2,4,5,7,10,13,15,17,22,28,31,36,39,50];

for i = 1:num_tracker
    if i == 1 || i == 3
        m(i) = plot(i,eao_sorted(i),'Marker','.','Color',Color_style(i,:),...
            'LineStyle','none','LineWidth',2,'MarkerSize',35);hold on;
    else
        m(i) = plot(i,eao_sorted(i),'Marker',Maker_style{mod(i-1,12)+1},'Color',Color_style(mod(i-1,7)+1,:),...
            'LineStyle','none','LineWidth',2,'MarkerSize',10);hold on;
    end
    plot([i,i],[0,eao_sorted(i)],'LineStyle',':','Color',[0.83 0.81 0.78]);hold on;
    if any(i == recent_index)
        plot(i+2, 0.05,'MarkerSize',6,'Marker','o','LineStyle','none',...
            'Color',[0.83 0.81 0.8],'LineWidth',2);hold on;
    end
end


set(gca,'xdir','reverse')
ylim([0,(eao_sorted(1)+0.05)]);
xlim([1, num_tracker]);
set(gca,'XTick',1:5:70);
set(gca,'YTick',0:0.05:(eao_sorted(1)+0.05))
set(gca,'linewidth',2);
set(gca,'FontSize',12);
% annotation('textarrow',[0.76,0.8],[0.76,0.72],'String','SAECO','FontWeight','bold','FontSize',12);
annotation('textbox',[.15,.8,.1,.1],'String','$$\hat{\Phi}$$','FontWeight','bold','FontSize',30,'LineStyle','none','Interpreter','latex','FitBoxToText','off')
box on

num_tracker_show = 10; % only write top10
for i = 1:num_tracker_show %
    legend_names{i} = [strrep(tracker_names{i},'_','\_'),...
        num2str(eao_sorted(i),'~[%0.3f]')];
end
legend(m(1:num_tracker_show),legend_names(1:num_tracker_show),...
    'Location','eastoutside','Interpreter', 'latex','FontSize',16)
set(gcf, 'position', [500 300 800 250]);
saveas(gcf,'../img/eao_rank_vot2016','pdf');
saveas(gcf,'../img/eao_rank_vot2016','png');

在这里插入图片描述

clear; close all; clc;
load('../data/attr_eao_vot2016.mat');

tracker_names = fieldnames(result);
legend_names = fieldnames(result.(tracker_names{1}));
num_tracker = length(tracker_names);
num_attr = length(legend_names);
eao = zeros(num_tracker,num_attr);
for i = 1:num_tracker
    for j = 1:num_attr
        eao(i,j) = result.(tracker_names{i}).(legend_names{j});
    end
end
[s,sorted_index] = sort(eao(:,1),'descend'); % rank by baseline eao

num_tracker_show = 10; % only write top10
tracker_names = tracker_names(sorted_index(1:num_tracker_show));
eao = eao(sorted_index(1:num_tracker_show),:);

eao(:,num_attr+1) = eao(:,1);

a_min = min(eao,[],1);
a_max = max(eao,[],1);

t = (0:1/num_attr:1)*2*pi;
h = [];
masker_shape = {'x','.'};
masker_size = {10,40};
color_masker = hsv(num_tracker_show);
color_line = color_masker*0.4 +ones(num_tracker_show,3)*0.6;
ax = polaraxes;

for i = 1:num_tracker_show
    h(i) = polarplot(t, (eao(i,:)-a_min)./(a_max-a_min)+0.2, 'MarkerSize',masker_size{mod(i,2)+1},...
        'Marker',masker_shape{mod(i,2)+1},'LineWidth',2,...
        'Color',color_line(i,:),'MarkerEdgeColor',color_masker(i,:)); hold on;
end

polarplot(t, 0.5, 'LineWidth',2, 'Color',[0,0,0]); hold on;


grid off
legend_names = {'Overall','Occlusion','Camera~motion','Size~change',...
    'Illumination~change','Motion~change', 'Unassigned'};
for i = 1:num_attr
    legend_names{i} = ['\begin{tabular}{c}', legend_names{i}, '\\',...
        [num2str(a_min(i),'(%.3f,') num2str(a_max(i),'%.3f)')], '\end{tabular}'];
end
ax.ThetaTickLabels = legend_names;
ThetaTick = (0:1/num_attr:1)*360;
ax.ThetaTick = ThetaTick(1:end-1);
ax.RTickLabels = [];
ax.TickLabelInterpreter = 'latex';

for i = 1:num_tracker_show %
    tracker_names{i} = strrep(tracker_names{i},'_','\_');
end 

ah1 = gca;
legend1=legend(ah1,h(1:5),tracker_names(1:5),'Orientation','horizontal','Location','southoutside');
ah2=axes('position',get(gca,'position'), 'visible','off');
legend2=legend(ah2,h(6:10),tracker_names(6:10),'Orientation','horizontal','Location','southoutside');
set(legend1,'Box','off')
set(legend2,'Box','off')
legend1_pos = get(legend1,'Position');
set(legend2,'Position',legend1_pos-[0,legend1_pos(4)*1.2,0,0]);

% set(gcf, 'position', [500 300 800 800]);
saveas(gcf,'../img/attr_eao_vot2016','pdf')
saveas(gcf,'../img/attr_eao_vot2016','png')

在这里插入图片描述

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值