Matlab读取yolov3训练的多个txt文件数据并绘图

Matlab读取yolov3训练的多个txt文件数据并绘图

最近用yolov3训练自己的数据,使用三种预训练权重,生成了三个txt文件数据,数据格式如下:
在这里插入图片描述首先将三个txt文件复制到matlab bin目录下,将数据导入到matlab中,在工作区会看到导入的数据。绘图代码如下
`data1 = load(‘noweights.txt’);
data2 = load(‘darknet53.txt’); % data1,2,3 加载txt文件
data3 = load(‘spp.txt’);
save(‘data1.mat’,‘data1’);save(‘data2.mat’,‘data2’);save(‘data3.mat’,‘data3’); %将txt保存为.mat格式

figure(1);
x = data1(:,1); %读取第一列数据
c1 = data1(:,3);
c2 = data2(:,3); % 读取第三列数据
c3 = data3(:,3);
subplot(251);
plot(x,c1,‘r:’);title(‘GIoU’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,4);
c2 = data2(:,4);
c3 = data3(:,4);
subplot(252);
plot(x,c1,‘r:’);title(‘Objectness’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,5);
c2 = data2(:,5);
c3 = data3(:,5);
subplot(253);
plot(x,c1,‘r:’);title(‘Classification’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,9);
c2 = data2(:,9);
c3 = data3(:,9);
subplot(254);
plot(x,c1,‘r:’);title(‘Precision’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,10);
c2 = data2(:,10);
c3 = data3(:,10);
subplot(255);
plot(x,c1,‘r:’);title(‘Recall’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,13);
c2 = data2(:,13);
c3 = data3(:,13);
subplot(256);
plot(x,c1,‘r:’);title(‘val GIoU’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,14);
c2 = data2(:,14);
c3 = data3(:,14);
subplot(257);
plot(x,c1,‘r:’);title(‘val Objectness’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,15);
c2 = data2(:,15);
c3 = data3(:,15);
subplot(258);
plot(x,c1,‘r:’);title(‘val Classification’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,11);
c2 = data2(:,11);
c3 = data3(:,11);
subplot(259);
plot(x,c1,‘r:’);title(‘map@0.5’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);

figure(1);
x = data1(:,1);
c1 = data1(:,12);
c2 = data2(:,12);
c3 = data3(:,12);
subplot(2,5,10);
plot(x,c1,‘r:’);title(‘F1’);xlabel(‘epochs’);ylabel(‘loss’);hold on;
plot(x,c2,‘b–’);hold on;
plot(x,c3,‘g’);`

绘制结果如下
在这里插入图片描述
绘制完后可以点击下图中位置,对坐标轴信息进行编辑
在这里插入图片描述

  • 7
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值