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