调整ucloud过期时间为5分钟,测试方法添加从ucloud获取的方式
This commit is contained in:
@@ -6,9 +6,12 @@ from pprint import pprint
|
||||
from paddlenlp import Taskflow
|
||||
from paddlenlp.utils.doc_parser import DocParser
|
||||
|
||||
from photo_review.util.ucloud import get_private_url
|
||||
|
||||
|
||||
def visual_model_test(task_path, test_img, schema):
|
||||
img = re.split(r'[\\/]', test_img)[-1]
|
||||
img = img.split("?")[0]
|
||||
img_name = ""
|
||||
img_type = "jpg"
|
||||
last_dot_index = img.rfind(".")
|
||||
@@ -34,22 +37,22 @@ def visual_model_test(task_path, test_img, schema):
|
||||
save_path="./img_result/" + img_name + "_my." + img_type)
|
||||
|
||||
|
||||
def main(model_type):
|
||||
def main(model_type, pic_name=None):
|
||||
# 开始时间
|
||||
start_time = time.time()
|
||||
|
||||
# 结算清单
|
||||
if model_type == "settlement":
|
||||
task_path = "../../config/model/settlement_list_model"
|
||||
test_img_path = "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 = ["姓名", "入院日期", "出院日期", "费用总额", "个人现金支付", "个人账户支付", "自费", "医保类型"]
|
||||
elif model_type == "discharge":
|
||||
task_path = "../../config/model/discharge_record_model"
|
||||
test_img_path = "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 = ["医院", "科别", "姓名", "入院日期", "出院日期", "主治医生"]
|
||||
elif model_type == "cost":
|
||||
task_path = "../../config/model/cost_list_model"
|
||||
test_img_path = "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 = ["姓名", "入院日期", "出院日期", "费用总额"]
|
||||
else:
|
||||
print("请输入正确的类型!")
|
||||
|
||||
Reference in New Issue
Block a user