Skip to content

Commit

Permalink
model switch 'use_gpu' use the same value from --gpu (#68)
Browse files Browse the repository at this point in the history
* model switch 'use_gpu' use the same value from --gpu

* fix code style

---------

Co-authored-by: aboutibm@163.com <7p=e763wN3A6k+[C>
Co-authored-by: Wang Xin <xinwang614@gmail.com>
  • Loading branch information
yes-github and GreatV authored Sep 7, 2024
1 parent f90256a commit ff235d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def __init__(
self.settings.load()
settings = self.settings
self.lang = lang
self.gpu = gpu

# Load string bundle for i18n
if lang not in ["ch", "en"]:
Expand Down Expand Up @@ -3181,15 +3182,15 @@ def modelChoose(self):
use_angle_cls=True,
det=True,
cls=True,
use_gpu=False,
use_gpu=self.gpu,
lang=choose_lang,
)
if choose_lang in ["ch", "en"]:
if hasattr(self, "table_ocr"):
del self.table_ocr
self.table_ocr = PPStructure(
use_pdserving=False,
use_gpu=False,
use_gpu=self.gpu,
lang=choose_lang,
layout=False,
show_log=False,
Expand Down

0 comments on commit ff235d3

Please sign in to comment.