mirror of
https://github.com/RapidAI/RapidOCR.git
synced 2026-11-10 21:10:55 +08:00
fix(python): fix incorrect usage of the exists function
This commit is contained in:
1 parent
f7978c650b
commit
2be4feff82
3 files changed
+9
-9
No files matched your search
@@ -31,7 +31,7 @@ logger = get_logger("RapidOCR")
|
||||
|
||||
class RapidOCR:
|
||||
def __init__(self, config_path: Optional[str] = None, **kwargs):
|
||||
if config_path is not None and Path(config_path).exists:
|
||||
if config_path is not None and Path(config_path).exists():
|
||||
config = read_yaml(config_path)
|
||||
else:
|
||||
config = read_yaml(DEFAULT_CFG_PATH)
|
||||
|
||||
@@ -31,11 +31,11 @@ logger = get_logger("RapidOCR")
|
||||
|
||||
class RapidOCR:
|
||||
def __init__(self, config_path: Optional[str] = None, **kwargs):
|
||||
config = read_yaml(DEFAULT_CFG_PATH)
|
||||
config = update_model_path(config)
|
||||
|
||||
if config_path is not None and Path(config_path).exists:
|
||||
if config_path is not None and Path(config_path).exists():
|
||||
config = read_yaml(config_path)
|
||||
else:
|
||||
config = read_yaml(DEFAULT_CFG_PATH)
|
||||
config = update_model_path(config)
|
||||
|
||||
if kwargs:
|
||||
updater = UpdateParameters()
|
||||
|
||||
@@ -31,11 +31,11 @@ logger = get_logger("RapidOCR")
|
||||
|
||||
class RapidOCR:
|
||||
def __init__(self, config_path: Optional[str] = None, **kwargs):
|
||||
config = read_yaml(DEFAULT_CFG_PATH)
|
||||
config = update_model_path(config)
|
||||
|
||||
if config_path is not None and Path(config_path).exists:
|
||||
if config_path is not None and Path(config_path).exists():
|
||||
config = read_yaml(config_path)
|
||||
else:
|
||||
config = read_yaml(DEFAULT_CFG_PATH)
|
||||
config = update_model_path(config)
|
||||
|
||||
if kwargs:
|
||||
updater = UpdateParameters()
|
||||
|
||||
Reference in new issue
Block a user