glenn-jocher commited on
Commit
db2c3ac
1 Parent(s): 915b148

updated testing settings, rebalanced towards FP16 latency

Browse files
Files changed (2) hide show
  1. test.py +2 -2
  2. utils/utils.py +1 -1
test.py CHANGED
@@ -35,7 +35,7 @@ def test(data,
35
  google_utils.attempt_download(weights)
36
  model = torch.load(weights, map_location=device)['model'].float() # load to FP32
37
  torch_utils.model_info(model)
38
- # model.fuse()
39
  model.to(device)
40
  if half:
41
  model.half() # to FP16
@@ -71,7 +71,7 @@ def test(data,
71
  batch_size,
72
  rect=True, # rectangular inference
73
  single_cls=opt.single_cls, # single class mode
74
- pad=0.0 if fast else 0.5) # padding
75
  batch_size = min(batch_size, len(dataset))
76
  nw = min([os.cpu_count(), batch_size if batch_size > 1 else 0, 8]) # number of workers
77
  dataloader = DataLoader(dataset,
 
35
  google_utils.attempt_download(weights)
36
  model = torch.load(weights, map_location=device)['model'].float() # load to FP32
37
  torch_utils.model_info(model)
38
+ model.fuse()
39
  model.to(device)
40
  if half:
41
  model.half() # to FP16
 
71
  batch_size,
72
  rect=True, # rectangular inference
73
  single_cls=opt.single_cls, # single class mode
74
+ pad=0.5) # padding
75
  batch_size = min(batch_size, len(dataset))
76
  nw = min([os.cpu_count(), batch_size if batch_size > 1 else 0, 8]) # number of workers
77
  dataloader = DataLoader(dataset,
utils/utils.py CHANGED
@@ -528,7 +528,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, fast=False, c
528
  fast |= conf_thres > 0.001 # fast mode
529
  if fast:
530
  merge = False
531
- multi_label = False
532
  else:
533
  merge = True # merge for best mAP (adds 0.5ms/img)
534
  multi_label = nc > 1 # multiple labels per box (adds 0.5ms/img)
 
528
  fast |= conf_thres > 0.001 # fast mode
529
  if fast:
530
  merge = False
531
+ multi_label = nc > 1 # multiple labels per box (adds 0.5ms/img)
532
  else:
533
  merge = True # merge for best mAP (adds 0.5ms/img)
534
  multi_label = nc > 1 # multiple labels per box (adds 0.5ms/img)