'lang {} is not support in {}, auto switch to version {}'.
format(lang,version,DEFAULT_MODEL_VERSION))
version=DEFAULT_MODEL_VERSION
version=DEFAULT_MODEL_VERSION
else:
else:
logger.error(
logger.error(
...
@@ -296,6 +294,8 @@ class PaddleOCR(predict_system.TextSystem):
...
@@ -296,6 +294,8 @@ class PaddleOCR(predict_system.TextSystem):
"""
"""
params=parse_args(mMain=False)
params=parse_args(mMain=False)
params.__dict__.update(**kwargs)
params.__dict__.update(**kwargs)
assertparams.ocr_versioninSUPPORT_OCR_MODEL_VERSION,"ocr_version must in {}, but get {}".format(
SUPPORT_OCR_MODEL_VERSION,params.ocr_version)
params.use_gpu=check_gpu(params.use_gpu)
params.use_gpu=check_gpu(params.use_gpu)
ifnotparams.show_log:
ifnotparams.show_log:
...
@@ -347,8 +347,9 @@ class PaddleOCR(predict_system.TextSystem):
...
@@ -347,8 +347,9 @@ class PaddleOCR(predict_system.TextSystem):
ocr with paddleocr
ocr with paddleocr
args:
args:
img: img for ocr, support ndarray, img_path and list or ndarray
img: img for ocr, support ndarray, img_path and list or ndarray
det: use text detection or not, if false, only rec will be exec. default is True
det: use text detection or not. If false, only rec will be exec. Default is True
rec: use text recognition or not, if false, only det will be exec. default is True
rec: use text recognition or not. If false, only det will be exec. Default is True
cls: use angle classifier or not. Default is True. If true, the text with rotation of 180 degrees can be recognized. If no text is rotated by 180 degrees, use cls=False to get better performance. Text with rotation of 90 or 270 degrees can be recognized even if cls=False.
"""
"""
assertisinstance(img,(np.ndarray,list,str))
assertisinstance(img,(np.ndarray,list,str))
ifisinstance(img,list)anddet==True:
ifisinstance(img,list)anddet==True:
...
@@ -398,6 +399,8 @@ class PPStructure(OCRSystem):
...
@@ -398,6 +399,8 @@ class PPStructure(OCRSystem):
def__init__(self,**kwargs):
def__init__(self,**kwargs):
params=parse_args(mMain=False)
params=parse_args(mMain=False)
params.__dict__.update(**kwargs)
params.__dict__.update(**kwargs)
assertparams.structure_versioninSUPPORT_STRUCTURE_MODEL_VERSION,"structure_version must in {}, but get {}".format(