Skip to content

Commit 1039ce4

Browse files
committed
Update task.py
1 parent b990d49 commit 1039ce4

File tree

1 file changed

+8
-7
lines changed
  • src/otx/algorithms/detection

1 file changed

+8
-7
lines changed

src/otx/algorithms/detection/task.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@ def __init__(self, task_environment: TaskEnvironment, output_path: Optional[str]
8383
)
8484
self._anchors: Dict[str, int] = {}
8585

86-
if self._hyperparams.postprocessing.result_based_confidence_threshold:
87-
self.confidence_threshold = 0.0 # Use all predictions to compute best threshold
88-
elif hasattr(self._hyperparams, "postprocessing"):
89-
if hasattr(self._hyperparams.postprocessing, "confidence_threshold"):
90-
self.confidence_threshold = self._hyperparams.postprocessing.confidence_threshold
91-
else:
92-
self.confidence_threshold = 0.0
86+
if (
87+
not self._hyperparams.postprocessing.result_based_confidence_threshold
88+
and hasattr(self._hyperparams, "postprocessing")
89+
and hasattr(self._hyperparams.postprocessing, "confidence_threshold")
90+
):
91+
self.confidence_threshold = self._hyperparams.postprocessing.confidence_threshold
92+
else:
93+
self.confidence_threshold = 0.0
9394

9495
if task_environment.model is not None:
9596
self._load_model()

0 commit comments

Comments
 (0)