Skip to content

Commit

Permalink
model switch 'use_gpu' use same value from --gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Sep 7, 2024
1 parent f90256a commit 56a7c0d
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 56a7c0d

Please sign in to comment.