From f028e13b1c4e0b988a9f2a73060bd9855c4f1145 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 8 Nov 2021 16:04:31 +0100 Subject: [PATCH] Add `--conf-thres` >> 0.001 warning (#5567) Partially addresses invalid mAPs at higher confidence threshold issue https://github.com/ultralytics/yolov5/issues/1466. --- val.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/val.py b/val.py index 2118ad400ac7..d2797f1189ec 100644 --- a/val.py +++ b/val.py @@ -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