如何绘制Gain/Loss曲线

如何计算呢:
Faster_Rcnn:90.91 FLOPs(G)
EY8-MFEM(ours):29.5 FLOPs(G)
90.91-29.5/29.5=2.08

import numpy as np
import matplotlib.pyplot as plt

models = ['EY8-MFEM(ours)','Faster_Rcnn','Tridentnet','Fcos','YOLOv3','YOLOv5s','YOLOv6s','YOLOv7','YOLOv8s','RTDETR-L','RTDETR-R50','RTDETR-R101']
gain_loss = [ 0,2.08,25.23,1.66,8.56,-0.193,0.49,2.49,-0.037,2.50,3.38,7.37] 

plt.figure(figsize=(12, 6))
plt.plot(models, gain_loss, marker='o', linestyle='-', color='orange', label='Gain/Loss (%)')
plt.xlabel('Models', fontsize=12)
plt.ylabel('Gain/Loss (%)', fontsize=12)
# plt.title('Performance Gain/Loss Comparison', fontsize=14)
plt.grid(axis='y', linestyle='--', alpha=0.7)
plt.axhline(0, color='black', linewidth=0.5)
plt.xticks(rotation=45, fontsize=10)
plt.yticks(fontsize=10)

# 计算纵轴范围
max_gain_loss = max(abs(max(gain_loss)), abs(min(gain_loss)))
y_range = (-max_gain_loss*1.1, max_gain_loss*1.1)

plt.ylim(y_range)  # 设置纵轴范围为对称的范围
plt.legend(fontsize=10)
plt.tight_layout()

plt.savefig('gain_loss_comparison_line_symmetric.png', dpi=1100, bbox_inches='tight')
plt.show()

在这里插入图片描述

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

毕竟是shy哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值