glenn-jocher commited on
Commit
ba4b79d
·
unverified ·
1 Parent(s): 4f9718a

Update val.py `--speed` and `--study` usages (#5120)

Browse files
Files changed (1) hide show
  1. val.py +2 -1
val.py CHANGED
@@ -333,12 +333,13 @@ def main(opt):
333
  run(**vars(opt))
334
 
335
  elif opt.task == 'speed': # speed benchmarks
 
336
  for w in opt.weights if isinstance(opt.weights, list) else [opt.weights]:
337
  run(opt.data, weights=w, batch_size=opt.batch_size, imgsz=opt.imgsz, conf_thres=.25, iou_thres=.45,
338
  device=opt.device, save_json=False, plots=False)
339
 
340
  elif opt.task == 'study': # run over a range of settings and save/plot
341
- # python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5s.pt yolov5m.pt yolov5l.pt yolov5x.pt
342
  x = list(range(256, 1536 + 128, 128)) # x axis (image sizes)
343
  for w in opt.weights if isinstance(opt.weights, list) else [opt.weights]:
344
  f = f'study_{Path(opt.data).stem}_{Path(w).stem}.txt' # filename to save to
 
333
  run(**vars(opt))
334
 
335
  elif opt.task == 'speed': # speed benchmarks
336
+ # python val.py --task speed --data coco.yaml --batch 1 --weights yolov5n.pt yolov5s.pt...
337
  for w in opt.weights if isinstance(opt.weights, list) else [opt.weights]:
338
  run(opt.data, weights=w, batch_size=opt.batch_size, imgsz=opt.imgsz, conf_thres=.25, iou_thres=.45,
339
  device=opt.device, save_json=False, plots=False)
340
 
341
  elif opt.task == 'study': # run over a range of settings and save/plot
342
+ # python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n.pt yolov5s.pt...
343
  x = list(range(256, 1536 + 128, 128)) # x axis (image sizes)
344
  for w in opt.weights if isinstance(opt.weights, list) else [opt.weights]:
345
  f = f'study_{Path(opt.data).stem}_{Path(w).stem}.txt' # filename to save to