import pandas as pd
import as plt
#Read the CSV file and replace it with its own absolute path
datav12_cdm = pd.read_csv('/mnt/user/qianzhu/YOLO/v12/yolov12-main/results/v12n-cdm/')
datav12n = pd.read_csv('/mnt/user/qianzhu/YOLO/v12/yolov12-main/results/v12n/')
datav11n = pd.read_csv('/mnt/user/qianzhu/YOLO/v12/yolov12-main/results/v11n/')
datav10n = pd.read_csv('/mnt/user/qianzhu/YOLO/v12/yolov12-main/results/v10n/')
datav8n = pd.read_csv('/mnt/user/qianzhu/YOLO/v12/yolov12-main/results/v8n/')
datav6n = pd.read_csv('/mnt/user/qianzhu/YOLO/v12/yolov12-main/results/v6n/')
#Get data for column metrics/mAP50-95(B) of each model separately
v12_cdm = datav12_cdm['metrics/mAP50-95(B)']
v12 = datav12n['metrics/mAP50-95(B)']
v11 = datav11n['metrics/mAP50-95(B)']
v10 = datav10n['metrics/mAP50-95(B)']
v8 = datav8n['metrics/mAP50-95(B)']
v6 = datav6n['metrics/mAP50-95(B)']
#Get the data of the epochs column and get the value every 20 epochs from the 20th data; the mAP50-95 trained (B is the same as
epochs = datav12_cdm['epoch'][19::20]
v12cdmd = v12_cdm[19::20]
v12d = v12[19::20]
v11d = v11[19::20]
v10d = v10[19::20]
v8d = v8[19::20]
v6d = v6[19::20]
#Draw a line chart, if you need to change it, check how to set the parameters in this function yourself
(epochs, v12cdmd, label='YOLOv12n-CDM(our)', marker='o',color='c')
(epochs, v12d, label='YOLOv12n', color='green',linestyle='--',alpha=0.8)
(epochs, v11d, label='YOLOv11n', color='blue',linestyle='--',alpha=0.8)
(epochs, v10d, label='YOLOv10n',color='black',linestyle='--',alpha=0.8)
(epochs, v8d, label='YOLOv8n',color='yellow',linestyle='--',alpha=0.8)
(epochs, v6d, label='YOLOv6n', color='red',linestyle='--',alpha=0.8)
#Set the icon title, x coordinate name, y coordinate name
('Object Detection')
('epochs')
('map50-95(B)')
#Add legend, in the lower right corner, default to the upper left corner
(loc='lower right')
#Setting up grid lines
(True)
#Save the image to the same directory, change it to the name you want to save, or use the absolute path to store it
('')