Browse Source

updated testing settings, rebalanced towards FP16 latency

5.0
Glenn Jocher 4 years ago
parent
commit
db2c3acd3a
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      test.py
  2. +1
    -1
      utils/utils.py

+ 2
- 2
test.py View File

@@ -35,7 +35,7 @@ def test(data,
google_utils.attempt_download(weights)
model = torch.load(weights, map_location=device)['model'].float() # load to FP32
torch_utils.model_info(model)
# model.fuse()
model.fuse()
model.to(device)
if half:
model.half() # to FP16
@@ -71,7 +71,7 @@ def test(data,
batch_size,
rect=True, # rectangular inference
single_cls=opt.single_cls, # single class mode
pad=0.0 if fast else 0.5) # padding
pad=0.5) # padding
batch_size = min(batch_size, len(dataset))
nw = min([os.cpu_count(), batch_size if batch_size > 1 else 0, 8]) # number of workers
dataloader = DataLoader(dataset,

+ 1
- 1
utils/utils.py View File

@@ -528,7 +528,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, fast=False, c
fast |= conf_thres > 0.001 # fast mode
if fast:
merge = False
multi_label = False
multi_label = nc > 1 # multiple labels per box (adds 0.5ms/img)
else:
merge = True # merge for best mAP (adds 0.5ms/img)
multi_label = nc > 1 # multiple labels per box (adds 0.5ms/img)

Loading…
Cancel
Save