diff --git a/ppocr/postprocess/__init__.py b/ppocr/postprocess/__init__.py index 3a4ebf52a3bd91ffd509b113103dab900588b0bd..5ca4e6bb96fc6f37ef67a2fb0b8c2496e1a83d77 100644 --- a/ppocr/postprocess/__init__.py +++ b/ppocr/postprocess/__init__.py @@ -29,10 +29,7 @@ from .rec_postprocess import CTCLabelDecode, AttnLabelDecode, SRNLabelDecode, Di TableLabelDecode, NRTRLabelDecode, SARLabelDecode , SEEDLabelDecode from .cls_postprocess import ClsPostProcess from .pg_postprocess import PGPostProcess - -if platform.system() != "Windows": - # pse is not support in Windows - from .pse_postprocess import PSEPostProcess +from .pse_postprocess import PSEPostProcess def build_post_process(config, global_config=None): diff --git a/ppocr/postprocess/pse_postprocess/pse/__init__.py b/ppocr/postprocess/pse_postprocess/pse/__init__.py index 97b8d8aff0cf229a4e3ec1961638273bd201822a..0536a32ea5614a8f1826ac2550b1f12518ac53e5 100644 --- a/ppocr/postprocess/pse_postprocess/pse/__init__.py +++ b/ppocr/postprocess/pse_postprocess/pse/__init__.py @@ -17,7 +17,12 @@ import subprocess python_path = sys.executable -if subprocess.call('cd ppocr/postprocess/pse_postprocess/pse;{} setup.py build_ext --inplace;cd -'.format(python_path), shell=True) != 0: - raise RuntimeError('Cannot compile pse: {}'.format(os.path.dirname(os.path.realpath(__file__)))) +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__)))) +os.chdir(ori_path) -from .pse import pse \ No newline at end of file +from .pse import pse diff --git a/tools/program.py b/tools/program.py index 6456aad5dcda764816e5af7b5becf30cc7192af4..f94ad83c532183f5a6ff458cfd8c0bfa814d5784 100755 --- a/tools/program.py +++ b/tools/program.py @@ -496,11 +496,6 @@ def preprocess(is_train=False): 'CLS', 'PGNet', 'Distillation', 'NRTR', 'TableAttn', 'SAR', 'PSE', 'SEED' ] - windows_not_support_list = ['PSE'] - if platform.system() == "Windows" and alg in windows_not_support_list: - logger.warning('{} is not support in Windows now'.format( - windows_not_support_list)) - sys.exit() device = 'gpu:{}'.format(dist.ParallelEnv().dev_id) if use_gpu else 'cpu' device = paddle.set_device(device)