diff --git a/docs/source/guide/tutorials/base/how_to_train/detection.rst b/docs/source/guide/tutorials/base/how_to_train/detection.rst index b91effaa2bc..90b0363d5f7 100644 --- a/docs/source/guide/tutorials/base/how_to_train/detection.rst +++ b/docs/source/guide/tutorials/base/how_to_train/detection.rst @@ -369,7 +369,7 @@ Please note, by default, the optimal confidence threshold is detected based on v .. code-block:: (otx) ...$ otx export --load-weights ../outputs/weights.pth \ - --output ../outputs + --output ../outputs \ params \ --postprocessing.confidence_threshold 0.5 \ --postprocessing.result_based_confidence_threshold false diff --git a/src/otx/algorithms/detection/task.py b/src/otx/algorithms/detection/task.py index 5ff417fdec5..a16a1b4302e 100644 --- a/src/otx/algorithms/detection/task.py +++ b/src/otx/algorithms/detection/task.py @@ -84,8 +84,8 @@ def __init__(self, task_environment: TaskEnvironment, output_path: Optional[str] self._anchors: Dict[str, int] = {} if ( - not self._hyperparams.postprocessing.result_based_confidence_threshold - and hasattr(self._hyperparams, "postprocessing") + hasattr(self._hyperparams, "postprocessing") + and not getattr(self._hyperparams.postprocessing, "result_based_confidence_threshold", False) and hasattr(self._hyperparams.postprocessing, "confidence_threshold") ): self.confidence_threshold = self._hyperparams.postprocessing.confidence_threshold