test augmentation comments
This commit is contained in:
parent
f91b1fb13a
commit
94344f5bea
4
test.py
4
test.py
|
@ -88,7 +88,8 @@ def test(cfg,
|
||||||
|
|
||||||
# Disable gradients
|
# Disable gradients
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
if augment: # augmented testing https://github.com/ultralytics/yolov3/issues/931
|
# Augment images
|
||||||
|
if augment: # https://github.com/ultralytics/yolov3/issues/931
|
||||||
imgs = torch.cat((imgs,
|
imgs = torch.cat((imgs,
|
||||||
imgs.flip(3), # flip-lr
|
imgs.flip(3), # flip-lr
|
||||||
torch_utils.scale_img(imgs, 0.7), # scale
|
torch_utils.scale_img(imgs, 0.7), # scale
|
||||||
|
@ -99,6 +100,7 @@ def test(cfg,
|
||||||
inf_out, train_out = model(imgs) # inference and training outputs
|
inf_out, train_out = model(imgs) # inference and training outputs
|
||||||
t0 += torch_utils.time_synchronized() - t
|
t0 += torch_utils.time_synchronized() - t
|
||||||
|
|
||||||
|
# De-augment results
|
||||||
if augment:
|
if augment:
|
||||||
x = torch.split(inf_out, nb, dim=0)
|
x = torch.split(inf_out, nb, dim=0)
|
||||||
x[1][..., 0] = width - x[1][..., 0] # flip lr
|
x[1][..., 0] = width - x[1][..., 0] # flip lr
|
||||||
|
|
Loading…
Reference in New Issue