Default confidences predict 0.25, val 0.001 (#149)

pull/153/head
Glenn Jocher 2 years ago committed by GitHub
parent 3cbf3ec455
commit 314da263c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ultralytics/yolo/configs/default.yaml
  2. 3
      ultralytics/yolo/engine/predictor.py
  3. 3
      ultralytics/yolo/engine/validator.py

@ -39,7 +39,7 @@ dropout: False # use dropout regularization
val: True # validate/test during training
save_json: False # save results to JSON file
save_hybrid: False # save hybrid version of labels (labels + additional predictions)
conf: 0.001 # object confidence threshold for detection
conf: null # object confidence threshold for detection (default 0.25 predict, 0.001 val)
iou: 0.7 # intersection over union (IoU) threshold for NMS
max_det: 300 # maximum number of detections per image
half: False # use half precision (FP16)

@ -77,7 +77,8 @@ class BasePredictor:
name = self.args.name or f"{self.args.mode}"
self.save_dir = increment_path(Path(project) / name, exist_ok=self.args.exist_ok)
(self.save_dir / 'labels' if self.args.save_txt else self.save_dir).mkdir(parents=True, exist_ok=True)
if self.args.conf is None:
self.args.conf = 0.25 # default conf=0.25
self.done_setup = False
# Usable if setup is done

@ -65,6 +65,9 @@ class BaseValidator:
exist_ok=self.args.exist_ok if RANK in {-1, 0} else True)
(self.save_dir / 'labels' if self.args.save_txt else self.save_dir).mkdir(parents=True, exist_ok=True)
if self.args.conf is None:
self.args.conf = 0.001 # default conf=0.001
self.callbacks = defaultdict(list, {k: [v] for k, v in callbacks.default_callbacks.items()}) # add callbacks
@smart_inference_mode()

Loading…
Cancel
Save