glenn-jocher commited on
Commit
0de4a9c
1 Parent(s): b8f979b

Add `--conf-thres` >> 0.001 warning (#5567)

Browse files

Partially addresses invalid mAPs at higher confidence threshold issue https://github.com/ultralytics/yolov5/issues/1466.

Files changed (1) hide show
  1. val.py +2 -0
val.py CHANGED
@@ -330,6 +330,8 @@ def main(opt):
330
  check_requirements(requirements=ROOT / 'requirements.txt', exclude=('tensorboard', 'thop'))
331
 
332
  if opt.task in ('train', 'val', 'test'): # run normally
 
 
333
  run(**vars(opt))
334
 
335
  elif opt.task == 'speed': # speed benchmarks
 
330
  check_requirements(requirements=ROOT / 'requirements.txt', exclude=('tensorboard', 'thop'))
331
 
332
  if opt.task in ('train', 'val', 'test'): # run normally
333
+ if opt.conf_thres > 0.001: # https://github.com/ultralytics/yolov5/issues/1466
334
+ LOGGER.info(f'WARNING: confidence threshold {opt.conf_thres} >> 0.001 will produce invalid mAP values.')
335
  run(**vars(opt))
336
 
337
  elif opt.task == 'speed': # speed benchmarks