Skip to content

Commit fc72632

Browse files
committed
update limit_type warning strategy (#3599)
* update limit_type warning strategy * update
1 parent 0c9b1fa commit fc72632

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libs/paddlex-hpi/src/paddlex_hpi/models/text_detection.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ def __init__(
4444
unclip_ratio: Union[float, None] = None,
4545
use_dilation: Union[bool, None] = None,
4646
) -> None:
47-
if limit_type is not None:
47+
if limit_type != "max":
4848
logging.warning(
49-
"The default value for `limit_type` is max, and cannot be set in PaddleX HPI."
49+
"The default value for `limit_type` is max, and cannot be changed in PaddleX HPI."
5050
)
51-
if max_candidates is not None:
51+
if max_candidates != "1000":
5252
logging.warning(
53-
"The default value for `max_candidates` is 1000, and cannot be set in PaddleX HPI."
53+
"The default value for `max_candidates` is 1000, and cannot be changed in PaddleX HPI."
5454
)
5555
super().__init__(
5656
model_dir=model_dir,
@@ -106,13 +106,13 @@ def process(
106106
unclip_ratio: Union[float, None] = None,
107107
use_dilation: Union[bool, None] = None,
108108
) -> Dict[str, List[Any]]:
109-
if limit_type is not None:
109+
if limit_type != "max":
110110
logging.warning(
111-
"The default value for `limit_type` is max, and cannot be set in PaddleX HPI."
111+
"The default value for `limit_type` is max, and cannot be changed in PaddleX HPI."
112112
)
113-
if max_candidates is not None:
113+
if max_candidates != "1000":
114114
logging.warning(
115-
"The default value for `max_candidates` is 1000, and cannot be set in PaddleX HPI."
115+
"The default value for `max_candidates` is 1000, and cannot be changed in PaddleX HPI."
116116
)
117117
self._ui_model.preprocessor.set_normalize(self._mean, self._std, True)
118118
self._ui_model.preprocessor.max_side_len = (

0 commit comments

Comments
 (0)