用代码yolov5生成map曲线对比图,map0.5,map0.5:0.95

map曲线对比图

map0.5
0.95
重点csv文件在runs/train/exp中!!

import pandas as pd
import matplotlib.pyplot as plt

# Function to clean column names
def clean_column_names(df):
    df.columns = df.columns.str.strip()
    df.columns = df.columns.str.replace('\s+', '_', regex=True)

#nonoresult.csv表示原始的结果图,csv文件在runs/train/exp中
original_results = pd.read_csv("noresult.csv")
#yesyesresult.csv表示提高后的结果图,csv文件在runs/train/exp中
improved_results = pd.read_csv("yesresult.csv")

# Clean column names
clean_column_names(original_results)
clean_column_names(improved_results)

# Plot mAP@0.5 curves
plt.figure()
#lable属性为曲线名称,自己可以定义
plt.plot(original_results['metrics/mAP_0.5'], label="Original YOLOv5")
plt.plot(improved_results['metrics/mAP_0.5'], label="Improved YOLOv5")
plt.xlabel("Epoch")
plt.ylabel("mAP@0.5")
plt.legend()
plt.title("mAP@0.5 Comparison")
plt.savefig("mAP_0.5_comparison.png")

# Plot mAP@0.5:0.95 curves
plt.figure()
plt.plot(original_results['metrics/mAP_0.5:0.95'], label="Original YOLOv5")
plt.plot(improved_results['metrics/mAP_0.5:0.95'], label="Improved YOLOv5")
plt.xlabel("Epoch")
plt.ylabel("mAP@0.5:0.95")
plt.legend()
#图的标题
plt.title("mAP@0.5:0.95 Comparison")
#图片名称
plt.savefig("mAP_0.5_0.95_comparison.png")

GitHub 加速计划 / yo / yolov5
552
37
下载
yolov5 - Ultralytics YOLOv8的前身,是一个用于目标检测、图像分割和图像分类任务的先进模型。
最近提交(Master分支:24 天前 )
6981c274 Refactor code for speed and clarity Co-authored-by: UltralyticsAssistant <web@ultralytics.com> 6 天前
f003c3df This commit resolves an issue where the save-csv command did not write the CSV header. The code now correctly saves the header in the CSV file. Signed-off-by: Ali Ghanbari <alighanbari446@gmail.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> 11 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐