From 7d37b3c52ee4e54c86560bc1dd9941635bef55f9 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 10 Oct 2021 23:20:42 -0700 Subject: [PATCH] Update val.py `pad = 0.0 if task == speed else 0.5` (#5121) * Update val.py `pad = 0.0 if task == speed else 0.5` * Cleanup --- val.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/val.py b/val.py index 6a0c95ac5ee1..2cd8eba87443 100644 --- a/val.py +++ b/val.py @@ -147,8 +147,9 @@ def run(data, if not training: if device.type != 'cpu': model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters()))) # run once + pad = 0.0 if task == 'speed' else 0.5 task = task if task in ('train', 'val', 'test') else 'val' # path to train/val/test images - dataloader = create_dataloader(data[task], imgsz, batch_size, gs, single_cls, pad=0.5, rect=True, + dataloader = create_dataloader(data[task], imgsz, batch_size, gs, single_cls, pad=pad, rect=True, prefix=colorstr(f'{task}: '))[0] seen = 0