This commit is contained in:
Glenn Jocher 2020-02-26 13:40:17 -08:00
parent b12f1a9abe
commit 2baa67cde2
1 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ def test(cfg,
verbose = opt.task == 'test'
# Remove previous
for f in glob.glob('test_batch*.jpg'):
for f in glob.glob('test_batch*.png'):
os.remove(f)
# Initialize model
@ -76,9 +76,9 @@ def test(cfg,
_, _, height, width = imgs.shape # batch size, channels, height, width
# Plot images with bounding boxes
if batch_i == 0 and not os.path.exists('test_batch0.png'):
plot_images(imgs=imgs, targets=targets, paths=paths, fname='test_batch0.png')
f = 'test_batch%g.png' % batch_i # filename
if batch_i < 1 and not os.path.exists(f):
plot_images(imgs=imgs, targets=targets, paths=paths, fname=f)
# Disable gradients
with torch.no_grad():