代码拉取完成,页面将自动刷新
import matplotlib.pyplot as plt
import numpy as np
import os
# 绘制 FPS 曲线
def yolo_streams_Fps():
# 准备数据
x_data = [1, 5, 10, 15, 20, 25]
y_data_1 = [260, 110, 50, 25, 10, 8]
y_data_2 = [112, 110, 60, 23, 0, 0]
y_data_3 = [110, 110, 110, 110, 0, 0]
y_5880Ada_8x = [70, 10, 4, 3, 2, 0]
y_1000_8x = [18, 4, 3, 1, 0, 0]
y_4000_8x = [18, 17, 16, 8, 0, 0]
# 创建图形和坐标轴对象
fig, ax = plt.subplots(figsize=(8, 6))
# 绘制折线图
ax.plot(x_data, y_data_1, color='blue', marker='s', linestyle='--', label='5880Ada-yolov8n')
ax.plot(x_data, y_data_2, color='red', marker='s', linestyle='--', label='AIEH1000-yolov8n')
ax.plot(x_data, y_data_3, color='green', marker='s', linestyle='--', label='AIEH4000-yolov8n')
ax.plot(x_data, y_5880Ada_8x, color='blue', marker='s', linestyle='-', label='5880Ada-yolov8x')
ax.plot(x_data, y_1000_8x, color='red', marker='s', linestyle='-', label='AIEH1000-yolov8x')
ax.plot(x_data, y_4000_8x, color='green', marker='s', linestyle='-', label='AIEH4000-yolov8x')
# 设置图形属性
ax.set_xlabel('Streams')
ax.set_ylabel('FPS')
ax.set_title('GPU,NPU FPS')
ax.legend()
ax.grid(True)
# 显示图形
plt.show()
def yolo_streams_GpuUse():
# 准备数据
x_data = [1, 5, 10, 15]
FPS_5880_8n = [260, 110, 50, 25]
FPS_5880_8x = [70, 10, 4, 3]
FPS_1000_8n = [112, 110, 60, 23]
FPS_1000_8x = [18, 4, 3, 1]
FPS_4000_8n = [110, 110, 110, 110]
FPS_4000_8x = [18, 17, 16, 8]
GpuUsage_5880_8n = [55, 70, 82, 80]
GpuUsage_5880_8x = [66, 93, 96, 98]
GpuUsage_1000_8n = [46, 100, 100, 100]
GpuUsage_1000_8x = [84, 100, 100, 100]
# GpuUsage_4000_8n = [46, 205, 207, 220]
# GpuUsage_4000_8x = [84, 392, 396, 398]
GpuUsage_4000_8n = [12, 51, 52, 55]
GpuUsage_4000_8x = [21, 98, 99, 99]
CpuUsage_5880_8n = [126, 321, 371, 342]
CpuUsage_5880_8x = [114, 188, 213, 193]
CpuUsage_1000_8n = [73, 318, 320, 320]
CpuUsage_1000_8x = [17, 20, 19, 19]
CpuUsage_4000_8n = [80, 296, 194, 297]
CpuUsage_4000_8x = [23, 89, 92, 94]
Memory_5880_8n = [51, 71, 96, 122]
Memory_5880_8x = [51, 71, 96, 115]
Gmemory_5880_8n = [45, 57, 67, 99]
Gmemory_5880_8x = [63, 145, 248, 353]
Memory_1000_8n = [19, 32, 52, 77]
Memory_1000_8x = [19, 38, 64, 83]
Memory_4000_8n = [13, 45, 83, 115]
Memory_4000_8x = [45, 70, 109, 147]
# 创建图形和坐标轴对象
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(8, 6))
# 在第一个子图中绘制正弦函数
axes[0, 0].plot(x_data, FPS_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes[0, 0].plot(x_data, FPS_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes[0, 0].plot(x_data, FPS_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes[0, 0].plot(x_data, FPS_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes[0, 0].plot(x_data, FPS_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes[0, 0].plot(x_data, FPS_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes[0, 0].set_title('Total Fps')
# 在第二个子图中绘制余弦函数
axes[0, 1].plot(x_data, Memory_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes[0, 1].plot(x_data, Memory_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes[0, 1].plot(x_data, Memory_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes[0, 1].plot(x_data, Memory_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes[0, 1].plot(x_data, Memory_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes[0, 1].plot(x_data, Memory_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes[0, 1].set_title('Memory Usage(M)')
# 在第三个子图中绘制正切函数
axes[1, 0].plot(x_data, GpuUsage_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes[1, 0].plot(x_data, GpuUsage_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes[1, 0].plot(x_data, GpuUsage_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes[1, 0].plot(x_data, GpuUsage_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes[1, 0].plot(x_data, GpuUsage_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes[1, 0].plot(x_data, GpuUsage_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes[1, 0].set_title('GPU-NPU Usage(%)')
# 在第四个子图中绘制指数函数
axes[1, 1].plot(x_data, CpuUsage_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes[1, 1].plot(x_data, CpuUsage_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes[1, 1].plot(x_data, CpuUsage_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes[1, 1].plot(x_data, CpuUsage_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes[1, 1].plot(x_data, CpuUsage_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes[1, 1].plot(x_data, CpuUsage_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes[1, 1].set_title('Cpu Usage(%)')
axes[0,0].legend()
axes[0,1].legend()
axes[1,0].legend()
axes[1,1].legend()
# 调整子图之间的间距
plt.tight_layout()
# 显示图形
plt.show()
def yolo_streams_GpuUse_FPS():
# 准备数据
x_data = [1, 5, 10, 15]
FPS_5880_8n = [260, 110, 50, 25]
FPS_5880_8x = [70, 10, 4, 3]
FPS_1000_8n = [112, 110, 60, 23]
FPS_1000_8x = [18, 4, 3, 1]
FPS_4000_8n = [110, 110, 110, 110]
FPS_4000_8x = [18, 17, 16, 8]
# 创建图形和坐标轴对象
fig, axes = plt.subplots(figsize=(8, 6))
# 在第一个子图中绘制正弦函数
axes.plot(x_data, FPS_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes.plot(x_data, FPS_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes.plot(x_data, FPS_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes.plot(x_data, FPS_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes.plot(x_data, FPS_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes.plot(x_data, FPS_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes.set_title('Total Fps')
axes.legend()
# 调整子图之间的间距
plt.tight_layout()
# 显示图形
plt.show()
def yolo_streams_GpuUse_MemoryUsage():
# 准备数据
x_data = [1, 5, 10, 15]
Memory_5880_8n = [51, 71, 96, 122]
Memory_5880_8x = [51, 71, 96, 115]
Gmemory_5880_8n = [45, 57, 67, 99]
Gmemory_5880_8x = [63, 145, 248, 353]
Memory_1000_8n = [19, 32, 52, 77]
Memory_1000_8x = [19, 38, 64, 83]
Memory_4000_8n = [13, 45, 83, 115]
Memory_4000_8x = [45, 70, 109, 147]
# 创建图形和坐标轴对象
fig, axes = plt.subplots(figsize=(8, 6))
# 在第二个子图中绘制余弦函数
axes.plot(x_data, Memory_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes.plot(x_data, Memory_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes.plot(x_data, Memory_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes.plot(x_data, Memory_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes.plot(x_data, Memory_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes.plot(x_data, Memory_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes.set_title('Memory Usage(M)')
axes.legend()
# 调整子图之间的间距
plt.tight_layout()
# 显示图形
plt.show()
def yolo_streams_GpuUse_Usage():
# 准备数据
x_data = [1, 5, 10, 15]
GpuUsage_5880_8n = [55, 70, 82, 80]
GpuUsage_5880_8x = [66, 93, 96, 98]
GpuUsage_1000_8n = [46, 100, 100, 100]
GpuUsage_1000_8x = [84, 100, 100, 100]
# GpuUsage_4000_8n = [46, 205, 207, 220]
# GpuUsage_4000_8x = [84, 392, 396, 398]
GpuUsage_4000_8n = [12, 51, 52, 55]
GpuUsage_4000_8x = [21, 98, 99, 99]
# 创建图形和坐标轴对象
fig, axes = plt.subplots(figsize=(8, 6))
# 在第三个子图中绘制正切函数
axes.plot(x_data, GpuUsage_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes.plot(x_data, GpuUsage_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes.plot(x_data, GpuUsage_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes.plot(x_data, GpuUsage_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes.plot(x_data, GpuUsage_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes.plot(x_data, GpuUsage_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes.set_title('GPU-NPU Usage(%)')
axes.legend()
# 调整子图之间的间距
plt.tight_layout()
# 显示图形
plt.show()
def yolo_streams_GpuUse_CpuUsage():
# 准备数据
x_data = [1, 5, 10, 15]
CpuUsage_5880_8n = [126, 321, 371, 342]
CpuUsage_5880_8x = [114, 188, 213, 193]
CpuUsage_1000_8n = [73, 318, 320, 320]
CpuUsage_1000_8x = [17, 20, 19, 19]
CpuUsage_4000_8n = [80, 296, 194, 297]
CpuUsage_4000_8x = [23, 89, 92, 94]
# 创建图形和坐标轴对象
fig, axes = plt.subplots(figsize=(8, 6))
# 在第四个子图中绘制指数函数
axes.plot(x_data, CpuUsage_5880_8n, color='green', marker='o', linestyle='-', label='5880Ada-yolov8n')
axes.plot(x_data, CpuUsage_5880_8x, color='green', marker='o', linestyle='--', label='5880Ada-yolov8x')
axes.plot(x_data, CpuUsage_1000_8n, color='blue', marker='s', linestyle='-', label='AIEH1000-yolov8n')
axes.plot(x_data, CpuUsage_1000_8x, color='blue', marker='s', linestyle='--', label='AIEH1000-yolov8x')
axes.plot(x_data, CpuUsage_4000_8n, color='red', marker='v', linestyle='-', label='AIEH4000-yolov8n')
axes.plot(x_data, CpuUsage_4000_8x, color='red', marker='v', linestyle='--', label='AIEH4000-yolov8x')
axes.set_title('Cpu Usage(%)')
axes.legend()
# 调整子图之间的间距
plt.tight_layout()
# 显示图形
plt.show()
def test_demo_1():
# 生成示例数据
x = np.linspace(0, 2 * np.pi, 100)
y1 = np.sin(x)
y2 = np.cos(x)
y3 = np.tan(x)
y4 = np.exp(x)
# 创建包含4个子图的图形布局
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(8, 6))
# 在第一个子图中绘制正弦函数
axes[0, 0].plot(x, y1)
axes[0, 0].set_title('Sin(x)')
# 在第二个子图中绘制余弦函数
axes[0, 1].plot(x, y2)
axes[0, 1].set_title('Cos(x)')
# 在第三个子图中绘制正切函数
axes[1, 0].plot(x, y3)
axes[1, 0].set_title('Tan(x)')
# 在第四个子图中绘制指数函数
axes[1, 1].plot(x, y4)
axes[1, 1].set_title('Exp(x)')
# 调整子图之间的间距
plt.tight_layout()
# 显示图形
plt.show()
# 按装订区域中的绿色按钮以运行脚本。
if __name__ == '__main__':
print('PyCharm')
# yolo_streams_Fps()
# test_demo_1()
# yolo_streams_GpuUse()
yolo_streams_GpuUse_FPS()
yolo_streams_GpuUse_MemoryUsage()
yolo_streams_GpuUse_Usage()
yolo_streams_GpuUse_CpuUsage()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。