help='OCR Model version, the current model support list is as follows: '
help='OCR Model version, the current model support list is as follows: '
'1. PP-OCRv2 Support Chinese detection and recognition model. '
'1. PP-OCRv2 Support Chinese detection and recognition model. '
...
@@ -199,7 +201,7 @@ def parse_args(mMain=True):
...
@@ -199,7 +201,7 @@ def parse_args(mMain=True):
parser.add_argument(
parser.add_argument(
"--structure_version",
"--structure_version",
type=str,
type=str,
choices=['STRUCTURE'],
choices=SUPPORT_STRUCTURE_MODEL_VERSION,
default='STRUCTURE',
default='STRUCTURE',
help='Model version, the current model support list is as follows:'
help='Model version, the current model support list is as follows:'
' 1. STRUCTURE Support en table structure model.')
' 1. STRUCTURE Support en table structure model.')
...
@@ -292,7 +294,7 @@ class PaddleOCR(predict_system.TextSystem):
...
@@ -292,7 +294,7 @@ 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_versionin['PP-OCR','PP-OCRv2']
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:
...
@@ -395,7 +397,7 @@ class PPStructure(OCRSystem):
...
@@ -395,7 +397,7 @@ 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_versionin['STRUCTURE']
assertparams.structure_versioninSUPPORT_STRUCTURE_MODEL_VERSION,"ocr_version must in {}, but get {}".format(SUPPORT_STRUCTURE_MODEL_VERSION,params.structure_version)