diff --git a/ppocr/postprocess/__init__.py b/ppocr/postprocess/__init__.py index 5ca4e6bb96fc6f37ef67a2fb0b8c2496e1a83d77..c6cb0144f7efd9ff7976ad67a658a554eafce754 100644 --- a/ppocr/postprocess/__init__.py +++ b/ppocr/postprocess/__init__.py @@ -18,7 +18,6 @@ from __future__ import print_function from __future__ import unicode_literals import copy -import platform __all__ = ['build_post_process'] @@ -26,21 +25,24 @@ from .db_postprocess import DBPostProcess, DistillationDBPostProcess from .east_postprocess import EASTPostProcess from .sast_postprocess import SASTPostProcess from .rec_postprocess import CTCLabelDecode, AttnLabelDecode, SRNLabelDecode, DistillationCTCLabelDecode, \ - TableLabelDecode, NRTRLabelDecode, SARLabelDecode , SEEDLabelDecode + TableLabelDecode, NRTRLabelDecode, SARLabelDecode, SEEDLabelDecode from .cls_postprocess import ClsPostProcess from .pg_postprocess import PGPostProcess -from .pse_postprocess import PSEPostProcess def build_post_process(config, global_config=None): support_dict = [ - 'DBPostProcess', 'PSEPostProcess', 'EASTPostProcess', 'SASTPostProcess', - 'CTCLabelDecode', 'AttnLabelDecode', 'ClsPostProcess', 'SRNLabelDecode', - 'PGPostProcess', 'DistillationCTCLabelDecode', 'TableLabelDecode', + 'DBPostProcess', 'EASTPostProcess', 'SASTPostProcess', 'CTCLabelDecode', + 'AttnLabelDecode', 'ClsPostProcess', 'SRNLabelDecode', 'PGPostProcess', + 'DistillationCTCLabelDecode', 'TableLabelDecode', 'DistillationDBPostProcess', 'NRTRLabelDecode', 'SARLabelDecode', 'SEEDLabelDecode' ] + if config['name'] == 'PSEPostProcess': + from .pse_postprocess import PSEPostProcess + support_dict.append('PSEPostProcess') + config = copy.deepcopy(config) module_name = config.pop('name') if global_config is not None: diff --git a/ppocr/postprocess/pse_postprocess/pse/__init__.py b/ppocr/postprocess/pse_postprocess/pse/__init__.py index 0536a32ea5614a8f1826ac2550b1f12518ac53e5..1903a9149a7703ac7ae9a66273eca620e0d77272 100644 --- a/ppocr/postprocess/pse_postprocess/pse/__init__.py +++ b/ppocr/postprocess/pse_postprocess/pse/__init__.py @@ -21,8 +21,9 @@ ori_path = os.getcwd() os.chdir('ppocr/postprocess/pse_postprocess/pse') if subprocess.call( '{} setup.py build_ext --inplace'.format(python_path), shell=True) != 0: - raise RuntimeError('Cannot compile pse: {}'.format( - os.path.dirname(os.path.realpath(__file__)))) + raise RuntimeError( + 'Cannot compile pse: {}, if your system is windows, you need to install all the default components of `desktop development using C++` in visual studio 2019+'. + format(os.path.dirname(os.path.realpath(__file__)))) os.chdir(ori_path) from .pse import pse