yan chuanli 2 years ago
parent
commit
98806447e8
4 changed files with 8 additions and 6 deletions
  1. 3 1
      TestAllOcr/test_interface.py
  2. 2 2
      to_md/use.py
  3. 2 2
      tools/convert_json.py
  4. 1 1
      tools/suffix.py

+ 3 - 1
TestAllOcr/test_interface.py

@@ -7,7 +7,7 @@ from config import send_request
 image_path = 'image'
 
 # DX_test, DX_sb, DX_test, DX_sb
-envl = 'DX_sb'
+envl = 'DX_test'
 url = config.URL[envl]
 token = config.TOKEN[envl]
 
@@ -18,6 +18,7 @@ class TestSbOcr(unittest.TestCase):
         root = Path(__file__).parent
         image_path = str(root / image_path)
         r = send_request(image_path, suffix, url, token)
+        print(r)
         self.assertIn('result', r, f'{suffix} test error')
 
     def test_bank(self):
@@ -57,6 +58,7 @@ class TestOcr(unittest.TestCase):
         root = Path(__file__).parent
         image_path = str(root / image_path)
         r = send_request(image_path, suffix, url, token)
+        print(r)
         self.assertIn('result', r, f'{suffix} test error')
 
     def test_bank(self):

+ 2 - 2
to_md/use.py

@@ -5,8 +5,8 @@ from new import MD, Image, Dataset, parser_path
 
 # config
 # 图片路径
-image_path = Path('/Users/sxkj/Desktop/测试文档/四六级/9.8/身份证/img')
-image_type = 1
+image_path = Path('/Users/sxkj/Desktop/户口本9.8/img')
+image_type = 0
 # 是否旋转
 image_rotate = True
 ocr_address = 'local'  # 'local' 'test' 'sb'

+ 2 - 2
tools/convert_json.py

@@ -6,9 +6,9 @@ import base64
 from itertools import chain
 
 url = 'http://192.168.199.27:18040'
-imgs_path = '户口本/首页'
+imgs_path = '../户口本筛选后样本集0927'
 
-def send_request(img_path, image_type = 1):
+def send_request(img_path, image_type = 0):
     with open(img_path, 'rb') as f:
         img_str: str = base64.encodebytes(f.read()).decode('utf-8')
         data = {

+ 1 - 1
tools/suffix.py

@@ -4,7 +4,7 @@ from itertools import chain
 import sys
 
 # conf
-target_path = '户口本'
+target_path = '../户口本筛选后样本集0927'
 #suffix = sys.argv[2]
 suffix = 'jpg' if len(sys.argv) != 3 else sys.argv[2]