Skip to content

Commit

Permalink
Add --conf-thres >> 0.001 warning (ultralytics#5567)
Browse files Browse the repository at this point in the history
Partially addresses invalid mAPs at higher confidence threshold issue ultralytics#1466.
  • Loading branch information
glenn-jocher committed Nov 8, 2021
1 parent 6dfed29 commit f028e13
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions val.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ def main(opt):
check_requirements(requirements=ROOT / 'requirements.txt', exclude=('tensorboard', 'thop'))

if opt.task in ('train', 'val', 'test'): # run normally
if opt.conf_thres > 0.001: # https://github.com/ultralytics/yolov5/issues/1466
LOGGER.info(f'WARNING: confidence threshold {opt.conf_thres} >> 0.001 will produce invalid mAP values.')
run(**vars(opt))

elif opt.task == 'speed': # speed benchmarks
Expand Down

0 comments on commit f028e13

Please sign in to comment.