Skip to content

Commit

Permalink
Update val.py pad = 0.0 if task == speed else 0.5 (#5121)
Browse files Browse the repository at this point in the history
* Update val.py `pad = 0.0 if task == speed else 0.5`

* Cleanup
  • Loading branch information
glenn-jocher authored Oct 11, 2021
1 parent ba4b79d commit 7d37b3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion val.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d37b3c

Please sign in to comment.