调整文件结构
This commit is contained in:
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
@@ -1,11 +1,14 @@
|
|||||||
# 可视化的模型对比测试
|
# 可视化的模型对比测试
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
from paddlenlp import Taskflow
|
from paddlenlp import Taskflow
|
||||||
from paddlenlp.utils.doc_parser import DocParser
|
from paddlenlp.utils.doc_parser import DocParser
|
||||||
|
|
||||||
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
from photo_review.util.ucloud import get_private_url
|
from photo_review.util.ucloud import get_private_url
|
||||||
|
|
||||||
|
|
||||||
@@ -52,22 +55,22 @@ def main(model_type, pic_name=None):
|
|||||||
|
|
||||||
if model_type == "ocr":
|
if model_type == "ocr":
|
||||||
task_path = None
|
task_path = None
|
||||||
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000638_1_094306_1.jpg"
|
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240428000832_1_093844_2.jpg"
|
||||||
schema = None
|
schema = None
|
||||||
elif model_type == "settlement":
|
elif model_type == "settlement":
|
||||||
task_path = "../../config/model/settlement_list_model"
|
task_path = "../config/model/settlement_list_model"
|
||||||
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000638_1_094306_1.jpg"
|
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000638_1_094306_1.jpg"
|
||||||
schema = ["姓名", "入院日期", "出院日期", "费用总额", "个人现金支付", "个人账户支付", "自费", "医保类型"]
|
schema = ["姓名", "入院日期", "出院日期", "费用总额", "个人现金支付", "个人账户支付", "自费", "医保类型"]
|
||||||
elif model_type == "discharge":
|
elif model_type == "discharge":
|
||||||
task_path = "../../config/model/discharge_record_model"
|
task_path = "../config/model/discharge_record_model"
|
||||||
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240401000003_3_001938_2.jpg"
|
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240401000003_3_001938_2.jpg"
|
||||||
schema = ["医院", "科别", "姓名", "入院日期", "出院日期", "主治医生"]
|
schema = ["医院", "科别", "姓名", "入院日期", "出院日期", "主治医生"]
|
||||||
elif model_type == "cost":
|
elif model_type == "cost":
|
||||||
task_path = "../../config/model/cost_list_model"
|
task_path = "../config/model/cost_list_model"
|
||||||
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000648_4_094542_2.jpg"
|
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000648_4_094542_2.jpg"
|
||||||
schema = ["姓名", "入院日期", "出院日期", "费用总额"]
|
schema = ["姓名", "入院日期", "出院日期", "费用总额"]
|
||||||
elif model_type == "cost_detail":
|
elif model_type == "cost_detail":
|
||||||
task_path = "../../config/model/cost_list_detail_model"
|
task_path = "../config/model/cost_list_detail_model"
|
||||||
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000648_4_094542_2.jpg"
|
test_img_path = get_private_url(pic_name) if pic_name else "img/PH20240511000648_4_094542_2.jpg"
|
||||||
schema = {"名称": ["类别", "规格", "单价", "数量", "金额"]}
|
schema = {"名称": ["类别", "规格", "单价", "数量", "金额"]}
|
||||||
else:
|
else:
|
||||||
@@ -81,8 +84,12 @@ def main(model_type, pic_name=None):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main("ocr")
|
# main("ocr")
|
||||||
# main("settlement")
|
main("settlement")
|
||||||
# main("discharge")
|
# main("discharge")
|
||||||
# main("cost")
|
# main("cost")
|
||||||
# main("cost_detail")
|
# main("cost_detail")
|
||||||
|
# write_visual_result("img/PH20240428000832_1_093844_2.jpg", layout=[([508.0975609756094,
|
||||||
|
# 659.7073170731707,
|
||||||
|
# 1000,
|
||||||
|
# 745.756097560976], 'lay', 'figure')])
|
||||||
Reference in New Issue
Block a user