Skip to content

Commit 2301163

Browse files
author
Songki Choi
committed
Hotfix: use 0 confidence threshold when computing best threshold based on F1
Signed-off-by: Songki Choi <[email protected]>
1 parent 2c54cc9 commit 2301163

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

otx/algorithms/detection/task.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,15 @@ def train(
225225
val_preds, val_map = self._infer_model(val_dataset, InferenceParameters(is_evaluation=True))
226226

227227
preds_val_dataset = val_dataset.with_empty_annotations()
228+
if self._hyperparams.postprocessing.result_based_confidence_threshold:
229+
confidence_threshold = 0.0 # Use all predictions to compute best threshold
230+
else:
231+
confidence_threshold = self.confidence_threshold
228232
self._add_predictions_to_dataset(
229-
val_preds, preds_val_dataset, self.confidence_threshold, use_ellipse_shapes=self.use_ellipse_shapes
233+
val_preds,
234+
preds_val_dataset,
235+
confidence_threshold=confidence_threshold,
236+
use_ellipse_shapes=self.use_ellipse_shapes
230237
)
231238

232239
result_set = ResultSetEntity(

0 commit comments

Comments
 (0)