zeke-chin 2 years ago
parent
commit
d3eed34f97
3 changed files with 28 additions and 11 deletions
  1. 2 2
      new.py
  2. 13 4
      ocr_config.py
  3. 13 5
      use.py

+ 2 - 2
new.py

@@ -161,7 +161,7 @@ class Dataset(object):
                     else:
                         image.category = False
                         self.error[key] += 1
-                        err_str += f'正确:{gt}<br>返回:{predict}<br>'
+                        err_str += f'-------{key}-------<br>正确:{gt}<br>返回:{predict}<br>'
             if image.category:
                 image.ocr_result = image.gt_result
             else:
@@ -250,7 +250,7 @@ class MD(object):
         self.write_header('True')
         self.f.new_table(columns=columns, rows=true_rows, text=self.true_table, text_align=text_align)
         self.write_header('False')
-        self.f.new_table(columns=columns, rows=false_rows, text=self.false_table, text_align=text_align)
+        self.f.new_table(columns=columns, rows=false_rows, text=self.false_table, text_align='left')
 
 # if __name__ == '__main__':
 #     markdown = MD('英语等级证书')

+ 13 - 4
ocr_config.py

@@ -1,3 +1,11 @@
+'''
+Author: zeke-chin zeke-chin@icloud.com
+Date: 2022-09-06 19:12:36
+LastEditors: zeke-chin zeke-chin@icloud.com
+LastEditTime: 2022-09-22 17:23:02
+FilePath: /to_md/ocr_config.py
+Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+'''
 from dataclasses import dataclass
 from typing import List
 
@@ -35,7 +43,7 @@ CET_CONFIGS = {
 }
 
 # regbook
-regbook_local_config = RequestConfig(url='http://192.168.199.249:18040/ocr_system/regbook', token='')
+regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
 regbook_test_config = RequestConfig(
     url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
     token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
@@ -55,7 +63,7 @@ OCR_CONFIGS = {
 }
 
 # business_license
-business_license_local_config = RequestConfig(url='http://192.168.199.249:18060/ocr_system/business_license', token='')
+business_license_local_config = RequestConfig(url='http://192.168.199.27:18060/ocr_system/business_license', token='')
 business_license_test_config = RequestConfig(
     url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
     token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
@@ -80,8 +88,9 @@ cet_field = ['orientation', 'name', 'id', 'language', 'level', 'exam_time', 'sco
 regbook_field = ['orientation', 'name', 'id', 'gender', 'birthplace', 'birthplace_province', 'birthplace_city',
                           'birthplace_region', 'native_place', 'native_place_province', 'native_place_city',
                           'native_place_region', 'blood_type', 'religion']
-
+business_license = ['orientation', 'social_code', 'company_name', 'legal_person', 'registered_capital', 'type', 'start_date', 'business_scope', 'expire_date', 'address', 'stamp']
 Filed = {
     'cet': cet_field,
-    'regbook': regbook_field
+    'regbook': regbook_field,
+    'business_license': business_license
 }

+ 13 - 5
use.py

@@ -1,3 +1,11 @@
+'''
+Author: zeke-chin zeke-chin@icloud.com
+Date: 2022-09-06 19:14:40
+LastEditors: zeke-chin zeke-chin@icloud.com
+LastEditTime: 2022-09-22 17:25:24
+FilePath: /to_md/use.py
+Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE`
+'''
 from pathlib import Path
 import time
 
@@ -5,14 +13,14 @@ from new import MD, Image, Dataset, parser_path
 
 # config
 # 图片路径
-image_path = Path('/Users/zeke/Downloads/9.1/专四/img')
-image_type = 0
+image_path = Path('/Users/zeke/work/sx/OCR/image_data/9.15营业执照/img')
+image_type = 1
 # 是否旋转
 image_rotate = False
 ocr_address = 'local'  # 'local' 'test' 'sb'
-ocr_name = 'cet'  # 'cet' 'idcard' 'bankcard' 'regbook' 'schoolcert'
-md_name = 'CET'
-filed = 'cet'
+ocr_name = 'business_license'  # 'cet' 'idcard' 'bankcard' 'regbook' 'schoolcert' 'business_license'
+md_name = ocr_name + image_path.name
+filed = ocr_name
 # 若md_path为None 则默认使用图片父路径为markdown保存路径
 # md_path = '/Users/zeke/work/sx/OCR/HROCR/to_md/example' or image_path.parent
 md_path = None or image_path.parent