diff --git a/deep_idocr.py b/deep_idocr.py index aff416f..3d5a8e3 100644 --- a/deep_idocr.py +++ b/deep_idocr.py @@ -104,8 +104,8 @@ def upload_file(): cv2.imwrite(path_debug_image_mask, id_card_img_mask) ## 返回结果 将其封装成json的键值对的格式 - data = [{"result":"sucess","response":{"name":key_ocr_res["name"],"address":key_ocr_res["address"],"month":key_ocr_res["month"],"minzu":key_ocr_res["minzu"],"year":key_ocr_res["year"],"sex":key_ocr_res["sex"],"id":key_ocr_res["id"],"day":key_ocr_res["day"]}}] - ## data = '{"result":"sucess"} + data = [{"result":"success","response":{"name":key_ocr_res["name"],"address":key_ocr_res["address"],"month":key_ocr_res["month"],"minzu":key_ocr_res["minzu"],"year":key_ocr_res["year"],"sex":key_ocr_res["sex"],"id":key_ocr_res["id"],"day":key_ocr_res["day"]}}] + ## data = '{"result":"success"} ## result = json.loads(data) return json.dumps(data,skipkeys=True,ensure_ascii=False,encoding="utf-8") else: