3 次代碼提交 a0b1c05114 ... a4c4e45e16

作者 SHA1 備註 提交日期
  yan chuanli a4c4e45e16 add filed 2 年之前
  yan chuanli 6571a67e62 add max_profit 2 年之前
  yan chuanli c751490c16 add max_profit 2 年之前

+ 82 - 4
HR_OCR/test_script/to_md/ocr_config.py

@@ -19,11 +19,80 @@ class Configs:
     request: RequestConfig
     type: Type
 
+# idcard
+idcard_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
+idcard_TXtest_config = RequestConfig(
+    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/sfzsbtest/idcard',
+    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
+idcard_TXsb_config = RequestConfig(
+    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/sfzsb/idcard',
+    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
+idcard_DXtest_config = RequestConfig(
+    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/sfzsbtest/idcard',
+    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
+idcard_DXsb_config = RequestConfig(
+    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/sfzsb/idcard',
+    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')
+
+IDCARD_CONFIGS = {
+    'local': idcard_local_config,
+    'TXtest': idcard_TXtest_config,
+    'TXsb': idcard_TXsb_config,
+    'DXtest': idcard_DXtest_config,
+    'DXsb': idcard_DXsb_config
+}
+
+# bankcard
+bankcard_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
+bankcard_TXtest_config = RequestConfig(
+    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/yhksbtest/bankcard',
+    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
+bankcard_TXsb_config = RequestConfig(
+    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/yhksb/bankcard',
+    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
+bankcard_DXtest_config = RequestConfig(
+    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/yhksbtest/bankcard',
+    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
+bankcard_DXsb_config = RequestConfig(
+    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/yhksb/bankcard',
+    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')
+
+BANKCARD_CONFIGS = {
+    'local': bankcard_local_config,
+    'TXtest': bankcard_TXtest_config,
+    'TXsb': bankcard_TXsb_config,
+    'DXtest': bankcard_DXtest_config,
+    'DXsb': bankcard_DXsb_config
+}
+
+# school
+school_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
+school_TXtest_config = RequestConfig(
+    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/xxwtest/schoolcert',
+    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
+school_TXsb_config = RequestConfig(
+    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/xxw/schoolcert',
+    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
+school_DXtest_config = RequestConfig(
+    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/xxwtest/schoolcert',
+    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
+school_DXsb_config = RequestConfig(
+    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/xxw/schoolcert',
+    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')
+
+SCHOOL_CONFIGS = {
+    'local': school_local_config,
+    'TXtest': school_TXtest_config,
+    'TXsb': school_TXsb_config,
+    'DXtest': school_DXtest_config,
+    'DXsb': school_DXsb_config
+}
+
 
 # cet
 cet_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
 cet_TXtest_config = RequestConfig(
-    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm//cettest/cet',
+    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
     token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
 cet_TXsb_config = RequestConfig(
     url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cet/cet',
@@ -46,7 +115,7 @@ CET_CONFIGS = {
 # regbook
 regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
 regbook_TXtest_config = RequestConfig(
-    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm//hkbsbtest/regbook',
+    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsbtest/regbook',
     token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
 regbook_TXsb_config = RequestConfig(
     url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
@@ -92,10 +161,16 @@ BLFE_CONFIGS = {
 OCR_CONFIGS = {
     'cet': CET_CONFIGS,
     'regbook': REGBOOK_CONFIGS,
-    'business_license': BLFE_CONFIGS
+    'business_license': BLFE_CONFIGS,
+    'schoolcert': SCHOOL_CONFIGS,
+    'idcard': IDCARD_CONFIGS,
+    'bankcard': BANKCARD_CONFIGS
 }
 
 # 字段
+idcard_fieid = ['orientation', 'name', 'id', 'ethnicity', 'gender', 'birthday', 'address', 'address_province', 'address_city', 'address_region', 'address_detail', 'expire_date']
+bankcard_fieid = ['orientation', 'number']
+schoolcert_fieid = ['orientation', 'name', 'gender', 'admission_time', 'education_time', 'education_level', 'education_type', 'learning_type', 'school', 'major', 'number']
 cet_field = ['orientation', 'name', 'id', 'language', 'level', 'exam_time', 'score']
 regbook_field = ['orientation', 'name', 'id', 'gender', 'birthplace', 'birthplace_province', 'birthplace_city',
                  'birthplace_region', 'native_place', 'native_place_province', 'native_place_city',
@@ -105,5 +180,8 @@ business_license = ['orientation', 'social_code', 'company_name', 'legal_person'
 Filed = {
     'cet': cet_field,
     'regbook': regbook_field,
-    'business_license': business_license
+    'business_license': business_license,
+    'schoolcert': schoolcert_fieid,
+    'idcard': idcard_fieid,
+    'bankcard': bankcard_fieid
 }

+ 4 - 2
HR_OCR/to_md/use.py

@@ -13,8 +13,10 @@ from new import MD, Image, Dataset, parser_path
 
 # config
 # 图片路径
-image_path = Path('/Users/zeke/work/sx/OCR/image_data/户口本9.30/0/img/')
-image_type = 0
+
+image_path = Path('/Users/sxkj/Desktop/9.29/1/img')
+image_type = 1
+
 # 是否旋转
 image_rotate = False
 ocr_address = 'DXtest'  # 'local' 'TXtest' 'TXsb' 'DXtest' 'DXsb'

+ 4 - 5
HR_OCR/tools/convert_json.py

@@ -5,15 +5,14 @@ import json
 import base64
 from itertools import chain
 
-url = 'http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr'
-imgs_path = './HR_OCR/to_md/example/img'
+url = 'http://192.168.199.27:18060'
+imgs_path = '/Users/sxkj/to_md/img'
 
-def send_request(img_path, image_type = 0):
+def send_request(img_path):
     with open(img_path, 'rb') as f:
         img_str: str = base64.encodebytes(f.read()).decode('utf-8')
         data = {
-            'image': img_str,
-            'image_type': image_type
+            'image': img_str
         }
         idc_header = {
             'Content-Type': 'application/json',

+ 4 - 0
HR_OCR/tools/suffix.py

@@ -4,7 +4,11 @@ from itertools import chain
 import sys
 
 # conf
+<<<<<<< HEAD
+target_path = '/Users/sxkj/to_md/9.29/1'
+=======
 target_path = './HR_OCR/to_md/example/img'
+>>>>>>> a0b1c051142a2687d8ae2c63f543f021d3239f1f
 #suffix = sys.argv[2]
 suffix = 'jpg' if len(sys.argv) != 3 else sys.argv[2]
 

+ 25 - 0
YQ_OCR/img/03-植选PET 内包—植选豆乳以团之名形象定制包装周艺轩版.json

@@ -0,0 +1,25 @@
+{
+    "productCategory": "产品种类:调制豆乳",
+    "ingredients": "配料:饮用水、大豆(非转基因)、白砂糖",
+    "proStanCode": "产品标准代号:GB/T30885",
+    "productionDate": "生产日期:见瓶盖",
+    "shelfLife": "保质期:常温密闭条件下9个月",
+    "storageConditions": "贮存条件:请保存于阴凉干燥处,避免阳光直晒、高温",
+    "conSerHotline": "消费者服务热线:4008169999",
+    "tips": "温馨提示:请勿带包装置于微波炉中加热。",
+    "welcome": "欢迎访问:www.yili.com",
+    "noKeyList": [
+        "植选",
+        "浓香豆乳畅饮系列",
+        "大豆添加量:44g/瓶",
+        "原味",
+        "全程非转基因可追溯大豆",
+        "3.0g/100mL",
+        "优质植物蛋白",
+        "保持环境清洁请勿乱抛空瓶",
+        "为保证产品风味,开启后需冷藏并尽快饮用完毕。",
+        "可能会有少量蛋白沉淀和脂肪上浮,属正常现象,请放心饮用。如发现涨瓶,请勿开启。",
+        "净含量:315mL",
+        "6907992515007"
+    ]
+}

+ 33 - 0
YQ_OCR/img/03-植选PET 内包—植选豆乳以团之名形象定制包装周艺轩版.md

@@ -0,0 +1,33 @@
+
+
+
+
+# 测试结果
+
+## 正确率:71.43%
+
+### 共21个字段,正确15个,错误6个
+
+|key值|正确答案|ocr返回结果|是否正确|
+| :---: | :---: | :---: | :---: |
+|productCategory|产品种类:调制豆乳|产品种类:调制豆乳|✅|
+|ingredients|配料:饮用水、大豆(非转基因)、白砂糖|配料:饮用水、大豆(非转基因)白砂糖大豆添加量:44g/瓶|❌|
+|proStanCode|产品标准代号:GB/T30885|产品标准代号:GB/T30885|✅|
+|productionDate|生产日期:见瓶盖|生产日期:见瓶盖|✅|
+|shelfLife|保质期:常温密闭条件下9个月|保质期:常温密闭条件下9个月|✅|
+|storageConditions|贮存条件:请保存于阴凉干燥处,避免阳光直晒、高温|贮存条件:请保存于阴凉干燥处,避免阳光直晒、高温。|❌|
+|conSerHotline|消费者服务热线:4008169999|消费者服务热线:4008169999|✅|
+|tips|温馨提示:请勿带包装置于微波炉中加热。|温馨提示:请勿带包装置于微波炉中加热。|✅|
+|welcome|欢迎访问:www.yili.com|欢迎访问:www.ili.com|❌|
+|无key值|植选|植选|✅|
+|无key值|浓香豆乳畅饮系列|浓香豆乳畅饮系列|✅|
+|无key值|大豆添加量:44g/瓶|生产日期:见瓶盖|❌|
+|无key值|原味|原味|✅|
+|无key值|全程非转基因可追溯大豆|全程非转基因可追溯大豆|✅|
+|无key值|3.0g/100mL|3.0g|❌|
+|无key值|优质植物蛋白|优质植物蛋白|✅|
+|无key值|保持环境清洁请勿乱抛空瓶|保持环境清洁请勿乱抛空瓶|✅|
+|无key值|为保证产品风味,开启后需冷藏并尽快饮用完毕。|为保证产品风味,开启后需冷藏并尽快饮用完毕。|✅|
+|无key值|可能会有少量蛋白沉淀和脂肪上浮,属正常现象,请放心饮用。如发现涨瓶,请勿开启。|可能会有少量蛋白沉淀和脂肪上浮属正常现象,请放心饮用。如发现胀瓶,请勿开启。|❌|
+|无key值|净含量:315mL|净含量:315mL|✅|
+|无key值|6907992515007|6907992515007|✅|

+ 23 - 0
YQ_OCR/img/巧克力味牛奶饮品.json

@@ -0,0 +1,23 @@
+{
+    "productCategory": "产品种类:配制型含乳饮料",
+    "ingredients": "配料:生牛乳、饮用水、白砂糖、可可粉、食品添加剂(微晶纤维素、单,双甘油脂肪酸酯、蔗糖脂肪酸酯、柠檬酸钠、结冷胶、安赛蜜、三氯蔗糖、食品用香精)",
+    "proStanCode": "产品标准代号:GB/T21732",
+    "productionDate": "生产日期:见盒顶部",
+    "shelfLife": "保质期:常温密闭条件下6个月",
+    "storageConditions": "贮存条件:未开启前,无需冷藏,开启之后,立即饮用。",
+    "conSerHotline": "消费者服务热线:4008169999",
+    "tips": "友情提示:喝前摇一摇",
+    "welcome": "欢迎访问:www.yili.com",
+    "noKeyList": [
+        "牛奶饮品",
+        "产品名称:巧克力味牛奶饮品",
+        "生产日期:见箱体",
+        "切勿带包装置于微波炉中加热",
+        "清真",
+        "保持环境清洁请勿乱抛空包",
+        "伊利",
+        "(具体生产商/产地见生产日期末端代码)",
+        "净含量:250mL",
+        "6907992500102"
+    ]
+}

+ 30 - 0
YQ_OCR/img/巧克力味牛奶饮品.md

@@ -0,0 +1,30 @@
+
+
+
+
+# 测试结果
+
+## 正确率:66.67%
+
+### 共18个字段,正确12个,错误6个
+
+|key值|正确答案|ocr返回结果|是否正确|
+| :---: | :---: | :---: | :---: |
+|productCategory|产品种类:配制型含乳饮料|产品种类:配制型含乳饮料|✅|
+|ingredients|配料:生牛乳、饮用水、白砂糖、可可粉、食品添加剂(微晶纤维素、单,双甘油脂肪酸酯、蔗糖脂肪酸酯、柠檬酸钠、结冷胶、安赛蜜、三氯蔗糖、食品用香精)|配料:生牛乳、饮用水、白砂糖可可粉、食品添加剂(微晶纤维素、单,双甘油脂肪酸酯、蔗糖脂肪酸酯柠檬酸钠、结冷胶、安赛蜜、三氯蔗糖、食品用香精)|❌|
+|proStanCode|产品标准代号:GB/T21732|产品标准代号:GB/T21732|✅|
+|productionDate|生产日期:见盒顶部|生产日期:见盒顶部|✅|
+|storageConditions|贮存条件:未开启前,无需冷藏,开启之后,立即饮用。|贮存条件:未开启前无需冷藏开启之后 立即饮用|❌|
+|conSerHotline|消费者服务热线:4008169999|消费者服务热线:4008169999|✅|
+|tips|友情提示:喝前摇一摇|友情提示:喝前摇一摇|✅|
+|welcome|欢迎访问:www.yili.com|欢迎访问:www.yli.com|❌|
+|无key值|牛奶饮品|牛奶饮品|✅|
+|无key值|产品名称:巧克力味牛奶饮品|产品名称:巧克力味牛奶饮品|✅|
+|无key值|生产日期:见箱体|生产日期:见盒顶部|❌|
+|无key值|切勿带包装置于微波炉中加热|切勿带包装置于微波炉中加热|✅|
+|无key值|清真|清真|✅|
+|无key值|保持环境清洁请勿乱抛空包|保持环境清洁请勿乱抛空包|✅|
+|无key值|伊利|伊利|✅|
+|无key值|(具体生产商/产地见生产日期末端代码)|(具体生产商/产地见生产日期末端代码)|❌|
+|无key值|净含量:250mL|净含量:250mL|❌|
+|无key值|6907992500102|6907992500102|✅|

+ 23 - 0
YQ_OCR/img/餐饮纯牛奶 内包.json

@@ -0,0 +1,23 @@
+{
+    "productCategory": "产品种类:全脂灭菌纯牛乳",
+    "ingredients": "配料:生牛乳",
+    "proStanCode": "产品标准代号:GB25190",
+    "productionDate": "生产日期:见盒顶部",
+    "shelfLife": "保质期:常温密闭条件下6个月",
+    "storageConditions": "贮存条件:未开启前无需冷藏开启之后请贮存于2-6℃并于2日内饮用完毕",
+    "conSerHotline": "消费者服务热线:4008169999",
+    "welcome": "欢迎访问:www.yili.com",
+    "noKeyList": [
+        "纯牛奶",
+        "餐饮之选",
+        "非脂乳固体≥8.5%",
+        "保持环境清洁请勿乱抛空包",
+        "切勿带包装置于微波炉中加热。",
+        "净含量:1L",
+        "6907992513621",
+        "内蒙古伊利实业集团股份有限公司出品 地址:内蒙古自治区呼和浩特市金山开发区金山大街1号",
+        "宁夏伊利乳业有限责任公司(A12) 产地及地址:宁夏吴忠市利通区金积工业园区 食品生产许可证编号:SC10564030200130",
+        "阜新伊利乳品有限责任公司(B6) 产地及地址:辽宁省阜新市阜蒙县园区路2号 食品生产许可证编号:SC10521090000011",
+        "定州伊利乳业有限责任公司(C1) 产地及地址:河北省定州市伊利工业园区 食品生产许可证编号:SC10613068200020"
+    ]
+}

+ 31 - 0
YQ_OCR/img/餐饮纯牛奶 内包.md

@@ -0,0 +1,31 @@
+
+
+
+
+# 测试结果
+
+## 正确率:94.74%
+
+### 共19个字段,正确18个,错误1个
+
+|key值|正确答案|ocr返回结果|是否正确|
+| :---: | :---: | :---: | :---: |
+|productCategory|产品种类:全脂灭菌纯牛乳|产品种类:全脂灭菌纯牛乳|✅|
+|ingredients|配料:生牛乳|配料:生牛乳|✅|
+|proStanCode|产品标准代号:GB25190|产品标准代号:GB25190|✅|
+|productionDate|生产日期:见盒顶部|生产日期:见盒顶部|✅|
+|shelfLife|保质期:常温密闭条件下6个月|保质期:常温密闭条件下6个月|✅|
+|storageConditions|贮存条件:未开启前无需冷藏开启之后请贮存于2-6℃并于2日内饮用完毕|贮存条件:未开启前无需冷藏开启之后请贮存于2-6℃并于2日内饮用完毕|✅|
+|conSerHotline|消费者服务热线:4008169999|消费者服务热线:4008169999|✅|
+|welcome|欢迎访问:www.yili.com|欢迎访问:www.yili.com|✅|
+|无key值|纯牛奶|纯牛奶|✅|
+|无key值|餐饮之选|餐饮之选|✅|
+|无key值|非脂乳固体≥8.5%|非脂乳固体≥8.5%|✅|
+|无key值|保持环境清洁请勿乱抛空包|保持环境清洁请勿乱抛空包|✅|
+|无key值|切勿带包装置于微波炉中加热。|切勿带包装置于微波炉中加热|❌|
+|无key值|净含量:1L|净含量:1L|✅|
+|无key值|6907992513621|6907992513621|✅|
+|无key值|内蒙古伊利实业集团股份有限公司出品 地址:内蒙古自治区呼和浩特市金山开发区金山大街1号|内蒙古伊利实业集团股份有限公司出品地址:内蒙古自治区呼和浩特市金山开发区金山大街1号|✅|
+|无key值|宁夏伊利乳业有限责任公司(A12) 产地及地址:宁夏吴忠市利通区金积工业园区 食品生产许可证编号:SC10564030200130|宁夏伊利乳业有限责任公司(A12)产地及地址:宁夏吴忠市利通区金积工业园区食品生产许可证编号:SC10564030200130|✅|
+|无key值|阜新伊利乳品有限责任公司(B6) 产地及地址:辽宁省阜新市阜蒙县园区路2号 食品生产许可证编号:SC10521090000011|阜新伊利乳品有限责任公司(B6)产地及地址:辽宁省阜新市阜蒙县园区路2号食品生产许可证编号:SC10521090000011|✅|
+|无key值|定州伊利乳业有限责任公司(C1) 产地及地址:河北省定州市伊利工业园区 食品生产许可证编号:SC10613068200020|定州伊利乳业有限责任公司(C1)产地及地址:河北省定州市伊利工业园区食品生产许可证编号:SC10613068200020|✅|