Esempio n. 1
0
 def debug(self, img_list: List[np.ndarray]):
     if self.online:
         img_str_list = [img_fp.dumps() for img_fp in img_list]
         try:
             return self.client("debug", self.lang, img_str_list)
         except:
             self.online = False
     from module.ocr.models import OCR_MODEL
     return OCR_MODEL.__getattribute__(self.lang).debug(img_list)
Esempio n. 2
0
 def ocr(self, img_fp: np.ndarray):
     if self.online:
         img_str = img_fp.dumps()
         try:
             return self.client("ocr", self.lang, img_str)
         except:
             self.online = False
     from module.ocr.models import OCR_MODEL
     return OCR_MODEL.__getattribute__(self.lang).ocr(img_fp)
Esempio n. 3
0
 def set_cand_alphabet(self, cand_alphabet: str):
     if self.online:
         try:
             return self.client("set_cand_alphabet", self.lang,
                                cand_alphabet)
         except:
             self.online = False
     from module.ocr.models import OCR_MODEL
     return OCR_MODEL.__getattribute__(
         self.lang).set_cand_alphabet(cand_alphabet)
Esempio n. 4
0
 def cnocr(self) -> "AlOcr":
     return OCR_MODEL.__getattribute__(self.lang)