mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
reinit
This commit is contained in:
parent
3763cb9aa4
commit
bea704ca6c
@ -94,13 +94,21 @@ class baseocr(commonbase):
|
||||
|
||||
########################################################
|
||||
def level2init(self):
|
||||
self.needinit = True
|
||||
try:
|
||||
self.initocr()
|
||||
except Exception as e:
|
||||
raise e
|
||||
self.needinit = False
|
||||
|
||||
def _private_ocr(self, imgpath):
|
||||
if self.needinit:
|
||||
self.level2init()
|
||||
try:
|
||||
text = self.ocr(imgpath)
|
||||
except Exception as e:
|
||||
self.needinit = True
|
||||
raise e
|
||||
return self._100_f(text)
|
||||
|
||||
def _100_f(self, line):
|
||||
|
Loading…
x
Reference in New Issue
Block a user