@@ -199,6 +199,7 @@ def get_str(str_id):
199199 "lang" : self .lang ,
200200 "text_detection_model_name" : "PP-OCRv5_server_det" ,
201201 "text_recognition_model_name" : "PP-OCRv5_server_rec" ,
202+ "enable_mkldnn" :False ,
202203 }
203204
204205 if det_model_dir is not None :
@@ -210,10 +211,10 @@ def get_str(str_id):
210211
211212 self .ocr = PaddleOCR (** params )
212213 self .text_recognizer = TextRecognition (
213- model_name = "PP-OCRv5_server_rec" , model_dir = rec_model_dir , device = self .gpu
214+ model_name = "PP-OCRv5_server_rec" , model_dir = rec_model_dir , device = self .gpu , enable_mkldnn = False
214215 )
215216 self .text_detector = TextDetection (
216- model_name = "PP-OCRv5_server_det" , model_dir = det_model_dir , device = self .gpu
217+ model_name = "PP-OCRv5_server_det" , model_dir = det_model_dir , device = self .gpu , enable_mkldnn = False
217218 )
218219 self .table_ocr = PPStructureV3 (
219220 use_doc_orientation_classify = False ,
@@ -224,6 +225,7 @@ def get_str(str_id):
224225 use_chart_recognition = False ,
225226 use_region_detection = False ,
226227 device = self .gpu ,
228+ enable_mkldnn = False ,
227229 )
228230
229231 if os .path .exists ("./data/paddle.png" ):
@@ -3148,7 +3150,12 @@ def TableRecognition(self):
31483150 )
31493151 QMessageBox .information (self , "Information" , msg )
31503152 # create an empty excel
3151- tablepyxl .document_to_xl ("" , excel_path )
3153+ try :
3154+ tablepyxl .document_to_xl ("" , excel_path )
3155+ except AttributeError : # 如果 tablepyxl 报错,改用 openpyxl
3156+ import openpyxl
3157+ wb = openpyxl .Workbook ()
3158+ wb .save (excel_path )
31523159 return
31533160
31543161 # automatically open excel annotation file
0 commit comments