updated testing settings, rebalanced towards FP16 latency

pull/1/head
Glenn Jocher 5 years ago
parent 915b1481fc
commit db2c3acd3a

@ -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,

@ -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