Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
85352c93
Commit
85352c93
authored
Oct 25, 2021
by
WenmuZhou
Browse files
add windows support of pse
parent
37331199
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
ppocr/postprocess/__init__.py
ppocr/postprocess/__init__.py
+1
-4
ppocr/postprocess/pse_postprocess/pse/__init__.py
ppocr/postprocess/pse_postprocess/pse/__init__.py
+8
-3
tools/program.py
tools/program.py
+0
-5
No files found.
ppocr/postprocess/__init__.py
View file @
85352c93
...
@@ -29,10 +29,7 @@ from .rec_postprocess import CTCLabelDecode, AttnLabelDecode, SRNLabelDecode, Di
...
@@ -29,10 +29,7 @@ from .rec_postprocess import CTCLabelDecode, AttnLabelDecode, SRNLabelDecode, Di
TableLabelDecode
,
NRTRLabelDecode
,
SARLabelDecode
,
SEEDLabelDecode
TableLabelDecode
,
NRTRLabelDecode
,
SARLabelDecode
,
SEEDLabelDecode
from
.cls_postprocess
import
ClsPostProcess
from
.cls_postprocess
import
ClsPostProcess
from
.pg_postprocess
import
PGPostProcess
from
.pg_postprocess
import
PGPostProcess
from
.pse_postprocess
import
PSEPostProcess
if
platform
.
system
()
!=
"Windows"
:
# pse is not support in Windows
from
.pse_postprocess
import
PSEPostProcess
def
build_post_process
(
config
,
global_config
=
None
):
def
build_post_process
(
config
,
global_config
=
None
):
...
...
ppocr/postprocess/pse_postprocess/pse/__init__.py
View file @
85352c93
...
@@ -17,7 +17,12 @@ import subprocess
...
@@ -17,7 +17,12 @@ import subprocess
python_path
=
sys
.
executable
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
:
ori_path
=
os
.
getcwd
()
raise
RuntimeError
(
'Cannot compile pse: {}'
.
format
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))))
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
from
.pse
import
pse
tools/program.py
View file @
85352c93
...
@@ -480,11 +480,6 @@ def preprocess(is_train=False):
...
@@ -480,11 +480,6 @@ def preprocess(is_train=False):
'CLS'
,
'PGNet'
,
'Distillation'
,
'NRTR'
,
'TableAttn'
,
'SAR'
,
'PSE'
,
'CLS'
,
'PGNet'
,
'Distillation'
,
'NRTR'
,
'TableAttn'
,
'SAR'
,
'PSE'
,
'SEED'
'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
=
'gpu:{}'
.
format
(
dist
.
ParallelEnv
().
dev_id
)
if
use_gpu
else
'cpu'
device
=
paddle
.
set_device
(
device
)
device
=
paddle
.
set_device
(
device
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment