PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.47k stars 7.84k forks source link

CPPD model for Scene Text Recognition not supported | AssertionError: assert alg in [...] #11322

Closed jaztiria closed 5 months ago

jaztiria commented 12 months ago

Hi all,

I'm trying to run the SOTA CPPD model fro Scene Text Recognition, but I'm affraid it is not fully supported yet.

Traceback (most recent call last): File "tools/eval.py", line 145, in config, device, logger, vdl_writer = program.preprocess() File "xxx/scene-text-recognition-projects/PaddleOCR/tools/program.py", line 660, in preprocess assert alg in [ AssertionError

The problem is that at this point of the code the option alg="CPPD" is not supported.

assert alg in [
        'EAST', 'DB', 'SAST', 'Rosetta', 'CRNN', 'STARNet', 'RARE', 'SRN',
        'CLS', 'PGNet', 'Distillation', 'NRTR', 'TableAttn', 'SAR', 'PSE',
        'SEED', 'SDMGR', 'LayoutXLM', 'LayoutLM', 'LayoutLMv2', 'PREN', 'FCE',
        'SVTR', 'SVTR_LCNet', 'ViTSTR', 'ABINet', 'DB++', 'TableMaster', 'SPIN',
        'VisionLAN', 'Gestalt', 'SLANet', 'RobustScanner', 'CT', 'RFL', 'DRRG',
        'CAN', 'Telescope', 'SATRN', 'SVTR_HGNet'
    ]

Is there any workaround? If I try to add "CPPD" to the previous list, then I obtain the next error:

File "xxx/scene-text-recognition-projects/PaddleOCR/ppocr/data/imaug/init.py", line 78, in create_operators op = eval(op_name)(**param) File "", line 1, in NameError: name 'CPPDLabelEncode' is not defined LAUNCH INFO 2023-11-29 10:57:54,271 Exit code 1

Thanks in advance,

Jon

trantuankhoi commented 11 months ago

https://github.com/PaddlePaddle/PaddleOCR/pull/10990

Have you update this code or pull from dygraph branch?