Browse Source

fix 样例

zeke-chin 2 years ago
parent
commit
ffe85d699e

+ 0 - 0
example/.ro_dst/03_img-1.jpg


+ 0 - 0
example/.ro_dst/03_img-2.jpg


+ 0 - 0
example/.ro_dst/03_img-3.jpg


+ 0 - 0
example/.ro_dst/05_img-1.jpg


+ 0 - 0
example/.ro_dst/05_img-2.jpg


+ 0 - 0
example/.ro_dst/05_img-3.jpg


BIN
example/.ro_dst/20-1.jpg


BIN
example/.ro_dst/20-2.jpg


BIN
example/.ro_dst/20-3.jpg


BIN
example/.ro_dst/25_img-1.jpg


BIN
example/.ro_dst/25_img-2.jpg


BIN
example/.ro_dst/25_img-3.jpg


+ 35 - 0
example/08-23_CET-tem_R.md

@@ -0,0 +1,35 @@
+
+
+
+
+# 08-23_CET-tem_R.md测试报告
+
+
+92.86%
+|字段|正确率|
+| :---: | :---: |
+|orientation|100.00%|
+|name|50.00%|
+|id|100.00%|
+|language|100.00%|
+|level|100.00%|
+|exam_time|100.00%|
+|score|100.00%|
+
+# True
+
+|图片|识别结果|
+| :---: | :---: |
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/img/20.jpg)|{'orientation': 0, 'name': '于海龙', 'id': '150424199401132415', 'language': '英语', 'level': 'CET4', 'exam_time': '2013年6月', 'score': '438'}|
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/.ro_dst/20-1.jpg)|{'orientation': 1, 'name': '于海龙', 'id': '150424199401132415', 'language': '英语', 'level': 'CET4', 'exam_time': '2013年6月', 'score': '438'}|
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/.ro_dst/20-2.jpg)|{'orientation': 2, 'name': '于海龙', 'id': '150424199401132415', 'language': '英语', 'level': 'CET4', 'exam_time': '2013年6月', 'score': '438'}|
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/.ro_dst/20-3.jpg)|{'orientation': 3, 'name': '于海龙', 'id': '150424199401132415', 'language': '英语', 'level': 'CET4', 'exam_time': '2013年6月', 'score': '438'}|
+
+# False
+
+|图片|识别结果|
+| :---: | :---: |
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/img/25_img.jpg)|正确:徐潇然<br>返回:徐然<br>|
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/.ro_dst/25_img-1.jpg)|正确:徐潇然<br>返回:徐然<br>|
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/.ro_dst/25_img-2.jpg)|正确:徐潇然<br>返回:徐然<br>|
+|![](/Users/zeke/work/sx/OCR/HROCR/to_md/example/.ro_dst/25_img-3.jpg)|正确:徐潇然<br>返回:徐然<br>|

+ 0 - 0
example/img/03_img.jpg


+ 0 - 9
example/img/03_img.json

@@ -1,9 +0,0 @@
-{
-    "orientation": 0,
-    "name": "李彩艳",
-    "id": "15263019940916792X",
-    "language": "英语",
-    "level": "CET4",
-    "exam_time": "2016年6月",
-    "score": "432"
-}

+ 0 - 0
example/img/05_img.jpg


+ 0 - 9
example/img/05_img.json

@@ -1,9 +0,0 @@
-{
-    "orientation": 0,
-    "name": "王鹤鸣",
-    "id": "370921199606203618",
-    "language": "英语",
-    "level": "CET4",
-    "exam_time": "2016年6月",
-    "score": "476"
-}

BIN
example/img/20.jpg


+ 9 - 0
example/img/20.json

@@ -0,0 +1,9 @@
+{
+    "orientation": 0,
+    "name": "于海龙",
+    "id": "150424199401132415",
+    "language": "英语",
+    "level": "CET4",
+    "exam_time": "2013年6月",
+    "score": "438"
+}

BIN
example/img/25_img.jpg


+ 9 - 0
example/img/25_img.json

@@ -0,0 +1,9 @@
+{
+    "orientation": 0,
+    "name": "徐潇然",
+    "id": "210404199610292117",
+    "language": "英语",
+    "level": "CET6",
+    "exam_time": "2018年06月",
+    "score": "435"
+}

+ 1 - 2
new.py

@@ -76,8 +76,7 @@ class Image:
             img = cv2.rotate(img, rotate)
             self.save_image(img, rotate)
         _, img = cv2.imencode('.jpg', img)
-        img_str = base64.b64encode(img).decode('utf-8')
-        return img_str
+        return base64.b64encode(img).decode('utf-8')
 
     def get_json(self):
         with open(self.json_path, 'r') as f:

+ 2 - 2
use.py

@@ -5,14 +5,14 @@ from new import MD, Image, Dataset, parser_path
 
 # config
 # 图片路径
-image_path = Path('/Users/zeke/work/sx/OCR/HROCR/hr-ocr-cet/markdown/md/tt/img')
+image_path = Path('/Users/zeke/work/sx/OCR/HROCR/to_md/example/img')
 image_type = None
 # 是否旋转
 image_rotate = True
 ocr_address = 'local'  # 'local' 'test' 'sb'
 ocr_name = 'cet'  # 'cet' 'idcard' 'bankcard' 'regbook' 'schoolcert'
 md_name = 'CET-tem'
-md_path = '/Users/zeke/work/sx/OCR/HROCR/hr-ocr-cet/markdown/md/tt'
+md_path = '/Users/zeke/work/sx/OCR/HROCR/to_md/example'
 md_file = parser_path(Path(md_path) / Path(md_name), image_rotate)