updates
This commit is contained in:
parent
9b55bbf9e2
commit
a0ef217842
|
@ -902,30 +902,6 @@ def plot_evolution_results(hyp): # from utils.utils import *; plot_evolution_re
|
||||||
plt.savefig('evolve.png', dpi=200)
|
plt.savefig('evolve.png', dpi=200)
|
||||||
|
|
||||||
|
|
||||||
def plot_results(start=0, stop=0): # from utils.utils import *; plot_results()
|
|
||||||
# Plot training results files 'results*.txt'
|
|
||||||
fig, ax = plt.subplots(2, 5, figsize=(14, 7))
|
|
||||||
ax = ax.ravel()
|
|
||||||
s = ['GIoU', 'Objectness', 'Classification', 'Precision', 'Recall',
|
|
||||||
'val GIoU', 'val Objectness', 'val Classification', 'mAP@0.5', 'F1']
|
|
||||||
for f in sorted(glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt')):
|
|
||||||
results = np.loadtxt(f, usecols=[2, 3, 4, 8, 9, 12, 13, 14, 10, 11], ndmin=2).T
|
|
||||||
n = results.shape[1] # number of rows
|
|
||||||
x = range(start, min(stop, n) if stop else n)
|
|
||||||
for i in range(10):
|
|
||||||
y = results[i, x]
|
|
||||||
if i in [0, 1, 2, 5, 6, 7]:
|
|
||||||
y[y == 0] = np.nan # dont show zero loss values
|
|
||||||
ax[i].plot(x, y, marker='.', label=f.replace('.txt', ''))
|
|
||||||
ax[i].set_title(s[i])
|
|
||||||
if i in [5, 6, 7]: # share train and val loss y axes
|
|
||||||
ax[i].get_shared_y_axes().join(ax[i], ax[i - 5])
|
|
||||||
|
|
||||||
fig.tight_layout()
|
|
||||||
ax[1].legend()
|
|
||||||
fig.savefig('results.png', dpi=200)
|
|
||||||
|
|
||||||
|
|
||||||
def plot_results_overlay(start=0, stop=0): # from utils.utils import *; plot_results_overlay()
|
def plot_results_overlay(start=0, stop=0): # from utils.utils import *; plot_results_overlay()
|
||||||
# Plot training results files 'results*.txt', overlaying train and val losses
|
# Plot training results files 'results*.txt', overlaying train and val losses
|
||||||
s = ['train', 'train', 'train', 'Precision', 'mAP@0.5', 'val', 'val', 'val', 'Recall', 'F1'] # legends
|
s = ['train', 'train', 'train', 'Precision', 'mAP@0.5', 'val', 'val', 'val', 'Recall', 'F1'] # legends
|
||||||
|
@ -949,6 +925,25 @@ def plot_results_overlay(start=0, stop=0): # from utils.utils import *; plot_re
|
||||||
fig.savefig(f.replace('.txt', '.png'), dpi=200)
|
fig.savefig(f.replace('.txt', '.png'), dpi=200)
|
||||||
|
|
||||||
|
|
||||||
def version_to_tuple(version):
|
def plot_results(start=0, stop=0): # from utils.utils import *; plot_results()
|
||||||
# Used to compare versions of library
|
# Plot training results files 'results*.txt'
|
||||||
return tuple(map(int, (version.split("."))))
|
fig, ax = plt.subplots(2, 5, figsize=(14, 7))
|
||||||
|
ax = ax.ravel()
|
||||||
|
s = ['GIoU', 'Objectness', 'Classification', 'Precision', 'Recall',
|
||||||
|
'val GIoU', 'val Objectness', 'val Classification', 'mAP@0.5', 'F1']
|
||||||
|
for f in sorted(glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt')):
|
||||||
|
results = np.loadtxt(f, usecols=[2, 3, 4, 8, 9, 12, 13, 14, 10, 11], ndmin=2).T
|
||||||
|
n = results.shape[1] # number of rows
|
||||||
|
x = range(start, min(stop, n) if stop else n)
|
||||||
|
for i in range(10):
|
||||||
|
y = results[i, x]
|
||||||
|
if i in [0, 1, 2, 5, 6, 7]:
|
||||||
|
y[y == 0] = np.nan # dont show zero loss values
|
||||||
|
ax[i].plot(x, y, marker='.', label=f.replace('.txt', ''))
|
||||||
|
ax[i].set_title(s[i])
|
||||||
|
if i in [5, 6, 7]: # share train and val loss y axes
|
||||||
|
ax[i].get_shared_y_axes().join(ax[i], ax[i - 5])
|
||||||
|
|
||||||
|
fig.tight_layout()
|
||||||
|
ax[1].legend()
|
||||||
|
fig.savefig('results.png', dpi=200)
|
||||||
|
|
Loading…
Reference in New Issue