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
56f31b81
"vscode:/vscode.git/clone" did not exist on "8199f09c2224647c454453f2adb7ba48692a1850"
Commit
56f31b81
authored
Jan 11, 2021
by
weishengyu
Browse files
dbg
parent
ce12c66f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
StyleText/engine/predictors.py
StyleText/engine/predictors.py
+1
-4
No files found.
StyleText/engine/predictors.py
View file @
56f31b81
...
...
@@ -15,7 +15,6 @@ import numpy as np
import
cv2
import
math
import
paddle
import
platform
from
arch
import
style_text_rec
from
utils.sys_funcs
import
check_gpu
...
...
@@ -24,15 +23,13 @@ from utils.logging import get_logger
class
StyleTextRecPredictor
(
object
):
def
__init__
(
self
,
config
):
self
.
logger
=
get_logger
()
algorithm
=
config
[
'Predictor'
][
'algorithm'
]
assert
algorithm
in
[
"StyleTextRec"
],
"Generator {} not supported."
.
format
(
algorithm
)
use_gpu
=
config
[
"Global"
][
'use_gpu'
]
if
use_gpu
and
paddle
.
is_compiled_with_cuda
()
and
platform
.
system
()
==
"Windows"
:
self
.
logger
.
error
(
"GPU mode on Windows is not supported."
)
check_gpu
(
use_gpu
)
paddle
.
set_device
(
'gpu'
if
use_gpu
else
'cpu'
)
self
.
logger
=
get_logger
()
self
.
generator
=
getattr
(
style_text_rec
,
algorithm
)(
config
)
self
.
height
=
config
[
"Global"
][
"image_height"
]
self
.
width
=
config
[
"Global"
][
"image_width"
]
...
...
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