Skip to content

Commit ff235d3

Browse files
yes-githubGreatV
andauthored
model switch 'use_gpu' use the same value from --gpu (#68)
* model switch 'use_gpu' use the same value from --gpu * fix code style --------- Co-authored-by: [email protected] <7p=e763wN3A6k+[C> Co-authored-by: Wang Xin <[email protected]>
1 parent f90256a commit ff235d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PPOCRLabel.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def __init__(
144144
self.settings.load()
145145
settings = self.settings
146146
self.lang = lang
147+
self.gpu = gpu
147148

148149
# Load string bundle for i18n
149150
if lang not in ["ch", "en"]:
@@ -3181,15 +3182,15 @@ def modelChoose(self):
31813182
use_angle_cls=True,
31823183
det=True,
31833184
cls=True,
3184-
use_gpu=False,
3185+
use_gpu=self.gpu,
31853186
lang=choose_lang,
31863187
)
31873188
if choose_lang in ["ch", "en"]:
31883189
if hasattr(self, "table_ocr"):
31893190
del self.table_ocr
31903191
self.table_ocr = PPStructure(
31913192
use_pdserving=False,
3192-
use_gpu=False,
3193+
use_gpu=self.gpu,
31933194
lang=choose_lang,
31943195
layout=False,
31953196
show_log=False,

0 commit comments

Comments
 (0)