glenn-jocher
commited on
verbose on final_epoch (#1997)
Browse files
test.py
CHANGED
@@ -37,7 +37,6 @@ def test(data,
|
|
37 |
plots=True,
|
38 |
log_imgs=0, # number of logged images
|
39 |
compute_loss=None):
|
40 |
-
|
41 |
# Initialize/load model and set device
|
42 |
training = model is not None
|
43 |
if training: # called by train.py
|
@@ -227,7 +226,7 @@ def test(data,
|
|
227 |
print(pf % ('all', seen, nt.sum(), mp, mr, map50, map))
|
228 |
|
229 |
# Print results per class
|
230 |
-
if (verbose or (nc
|
231 |
for i, c in enumerate(ap_class):
|
232 |
print(pf % (names[c], seen, nt[c], p[i], r[i], ap50[i], ap[i]))
|
233 |
|
|
|
37 |
plots=True,
|
38 |
log_imgs=0, # number of logged images
|
39 |
compute_loss=None):
|
|
|
40 |
# Initialize/load model and set device
|
41 |
training = model is not None
|
42 |
if training: # called by train.py
|
|
|
226 |
print(pf % ('all', seen, nt.sum(), mp, mr, map50, map))
|
227 |
|
228 |
# Print results per class
|
229 |
+
if (verbose or (nc < 50 and not training)) and nc > 1 and len(stats):
|
230 |
for i, c in enumerate(ap_class):
|
231 |
print(pf % (names[c], seen, nt[c], p[i], r[i], ap50[i], ap[i]))
|
232 |
|
train.py
CHANGED
@@ -344,6 +344,7 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
|
|
344 |
single_cls=opt.single_cls,
|
345 |
dataloader=testloader,
|
346 |
save_dir=save_dir,
|
|
|
347 |
plots=plots and final_epoch,
|
348 |
log_imgs=opt.log_imgs if wandb else 0,
|
349 |
compute_loss=compute_loss)
|
|
|
344 |
single_cls=opt.single_cls,
|
345 |
dataloader=testloader,
|
346 |
save_dir=save_dir,
|
347 |
+
verbose=nc < 50 and final_epoch,
|
348 |
plots=plots and final_epoch,
|
349 |
log_imgs=opt.log_imgs if wandb else 0,
|
350 |
compute_loss=compute_loss)
|