diff --git a/.idea/deployment.xml b/.idea/deployment.xml index 2c614fd..8c75b9a 100644 --- a/.idea/deployment.xml +++ b/.idea/deployment.xml @@ -1,6 +1,6 @@ - + @@ -56,7 +56,7 @@ - + @@ -67,6 +67,20 @@ + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 72af4a7..92703ee 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,6 +5,7 @@ + @@ -362,7 +363,9 @@ - + + + @@ -414,7 +417,7 @@ - + diff --git a/test/baidusdk/baidusdk.py b/test/baidusdk/baidusdk.py index 208de6f..03e6e01 100644 --- a/test/baidusdk/baidusdk.py +++ b/test/baidusdk/baidusdk.py @@ -8,7 +8,7 @@ client = AipOcr(str(28173504), 'kqrFE7VuygIaFer7z6cRxzoi', 'yp7xBokyl4TItyGhay7skAN1cMwfvEXf') # client = AipOcr(str(28324292), 'l58x9bqCsPOpyexGqrM86jhy', # '1qECRaULUZBfOPejVIWUGLahUHGMQoni') -im0 = cv2.imread('/home/chenyukun/healthCode/imgs/jkm/1668493089006.jpg') +im0 = cv2.imread('/home/chenyukun/healthCode/imgs/jkm/il4g3jm4y27_1668730977634.jfif_phoneNumberImage.jpg') or_result, or_image = cv2.imencode(".jpg", im0) # with open("/home/chenyukun/fk/fk_application.yml", 'r', encoding='utf-8') as f: @@ -21,8 +21,8 @@ or_result, or_image = cv2.imencode(".jpg", im0) def aa(a): # res_image = orc.universal_text_recognition(im0,'aaaaaaaa') - res_image = client.licensePlate(or_image.tobytes()) - # res_image = client.basicGeneral(or_image.tobytes()) + # res_image = client.licensePlate(or_image.tobytes()) + res_image = client.basicGeneral(or_image.tobytes()) # res_image = orc.license_plate_recognition(im0,'aa') print(res_image) # print(res_image1) diff --git a/util/ModelUtils.py b/util/ModelUtils.py index b5503c7..f911876 100644 --- a/util/ModelUtils.py +++ b/util/ModelUtils.py @@ -33,13 +33,13 @@ class FKModel(Model): def process(self, im0, device, img_type): try: # 预处理 - img, padInfos = pre_process(im0, device) + img, padInfos = pre_process(im0, self.device) # 模型推理 code, plate if img_type == 'code': pred = self.model(img) if img_type == 'plate': pred = self.model_plate(img) - boxes = post_process(pred, padInfos, device, conf_thres=self.par['conf_thres'], + boxes = post_process(pred, padInfos, self.device, conf_thres=self.par['conf_thres'], iou_thres=self.par['iou_thres'], nc=self.par[img_type]['nc']) # 后处理 dataBack = get_return_data(im0, boxes, modelType=img_type, plate_dilate=self.par['plate_dilate'])