This commit is contained in:
恍兮惚兮 2024-05-05 21:27:03 +08:00
parent 3763cb9aa4
commit bea704ca6c

View File

@ -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):