This commit is contained in:
Glenn Jocher 2019-04-01 20:27:11 +02:00
parent a76e8e3ee8
commit bd32517528
2 changed files with 4 additions and 6 deletions

View File

@ -40,8 +40,8 @@ def test(
# Configure run # Configure run
data_cfg = parse_data_cfg(data_cfg) data_cfg = parse_data_cfg(data_cfg)
test_path = data_cfg['valid'] test_path = data_cfg['valid']
if (os.sep + 'coco' + os.sep) in test_path: # COCO dataset probable # if (os.sep + 'coco' + os.sep) in test_path: # COCO dataset probable
save_json = True # use pycocotools # save_json = True # use pycocotools
# Dataloader # Dataloader
dataset = LoadImagesAndLabels(test_path, img_size=img_size) dataset = LoadImagesAndLabels(test_path, img_size=img_size)

View File

@ -477,13 +477,13 @@ def plot_wh_methods(): # from utils.utils import *; plot_wh_methods()
def plot_results(start=0): # from utils.utils import *; plot_results() def plot_results(start=0): # from utils.utils import *; plot_results()
# Plot YOLO training results file 'results.txt' # Plot training results files 'results*.txt'
# import os; os.system('wget https://storage.googleapis.com/ultralytics/yolov3/results_v3.txt') # import os; os.system('wget https://storage.googleapis.com/ultralytics/yolov3/results_v3.txt')
fig = plt.figure(figsize=(14, 7)) fig = plt.figure(figsize=(14, 7))
s = ['X + Y', 'Width + Height', 'Confidence', 'Classification', 'Total Loss', 'Precision', 'Recall', 'mAP'] s = ['X + Y', 'Width + Height', 'Confidence', 'Classification', 'Total Loss', 'Precision', 'Recall', 'mAP']
for f in sorted(glob.glob('results*.txt')): for f in sorted(glob.glob('results*.txt')):
results = np.loadtxt(f, usecols=[2, 3, 4, 5, 6, 9, 10, 11, 12]).T # column 11 is mAP results = np.loadtxt(f, usecols=[2, 3, 4, 5, 6, 9, 10, 11]).T # column 11 is mAP
x = range(start, results.shape[1]) x = range(start, results.shape[1])
for i in range(8): for i in range(8):
plt.subplot(2, 4, i + 1) plt.subplot(2, 4, i + 1)
@ -491,7 +491,5 @@ def plot_results(start=0): # from utils.utils import *; plot_results()
plt.title(s[i]) plt.title(s[i])
if i == 0: if i == 0:
plt.legend() plt.legend()
if i == 7:
plt.plot(x, results[i + 1, x], marker='.', label=f)
fig.tight_layout() fig.tight_layout()
fig.savefig('results.jpg', dpi=fig.dpi) fig.savefig('results.jpg', dpi=fig.dpi)