-
Notifications
You must be signed in to change notification settings - Fork 5
/
plot_result.py
100 lines (84 loc) · 2.38 KB
/
plot_result.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import os
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
pwd = os.getcwd()
names = []
plt.figure(figsize=(10, 10))
plt.subplot(2, 2, 1)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' metrics/precision(B)'], label=i)
plt.xlabel('epoch')
plt.title('precision')
plt.legend()
plt.subplot(2, 2, 2)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' metrics/recall(B)'], label=i)
plt.xlabel('epoch')
plt.title('recall')
plt.legend()
plt.subplot(2, 2, 3)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' metrics/mAP50(B)'], label=i)
plt.xlabel('epoch')
plt.title('mAP_0.5')
plt.legend()
plt.subplot(2, 2, 4)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' metrics/mAP50-95(B)'], label=i)
plt.xlabel('epoch')
plt.title('mAP_0.5:0.95')
plt.legend()
plt.tight_layout()
plt.savefig('metrice_curve.png')
print(f'metrice_curve.png save in {pwd}/metrice_curve.png')
plt.figure(figsize=(15, 10))
plt.subplot(2, 3, 1)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' train/box_loss'], label=i)
plt.xlabel('epoch')
plt.title('train/box_loss')
plt.legend()
plt.subplot(2, 3, 2)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' train/dfl_loss'], label=i)
plt.xlabel('epoch')
plt.title('train/dfl_loss')
plt.legend()
plt.subplot(2, 3, 3)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' train/cls_loss'], label=i)
plt.xlabel('epoch')
plt.title('train/cls_loss')
plt.legend()
plt.subplot(2, 3, 4)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' val/box_loss'], label=i)
plt.xlabel('epoch')
plt.title('val/box_loss')
plt.legend()
plt.subplot(2, 3, 5)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' val/dfl_loss'], label=i)
plt.xlabel('epoch')
plt.title('val/dfl_loss')
plt.legend()
plt.subplot(2, 3, 6)
for i in names:
data = pd.read_csv(f'runs/train/{i}/results.csv')
plt.plot(data[' val/cls_loss'], label=i)
plt.xlabel('epoch')
plt.title('val/cls_loss')
plt.legend()
plt.tight_layout()
plt.savefig('loss_curve.png')
print(f'loss_curve.png save in {pwd}/loss_curve.png')