MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / check_model_settings_valid

Method check_model_settings_valid

tools/infer_doc.py:261–279  ·  view source on GitHub ↗

Check if the input parameters are valid based on the initialized models. Args: input_params (Dict): A dictionary containing input parameters. Returns: bool: True if all required models are initialized according to input parameters, False otherwise.

(self, input_params: dict)

Source from the content-addressed store, hash-verified

259 )
260
261 def check_model_settings_valid(self, input_params: dict) -> bool:
262 """
263 Check if the input parameters are valid based on the initialized models.
264
265 Args:
266 input_params (Dict): A dictionary containing input parameters.
267
268 Returns:
269 bool: True if all required models are initialized according to input parameters, False otherwise.
270 """
271
272 if input_params[
273 'use_doc_preprocessor'] and not self.use_doc_preprocessor:
274 logging.error(
275 'Set use_doc_preprocessor, but the models for doc preprocessor are not initialized.',
276 )
277 return False
278
279 return True
280
281 def get_layout_parsing_results(
282 self,

Callers 1

predictMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected