提交 444080a0 编写于 作者: 文幕地方's avatar 文幕地方

update vis

上级 ba284a2b
...@@ -37,6 +37,7 @@ from ppocr.postprocess import build_post_process ...@@ -37,6 +37,7 @@ from ppocr.postprocess import build_post_process
from ppocr.utils.save_load import load_model from ppocr.utils.save_load import load_model
from ppocr.utils.utility import get_image_file_list from ppocr.utils.utility import get_image_file_list
from ppocr.utils.visual import draw_rectangle from ppocr.utils.visual import draw_rectangle
from tools.infer.utility import draw_boxes
import tools.program as program import tools.program as program
import cv2 import cv2
...@@ -105,9 +106,13 @@ def main(config, device, logger, vdl_writer): ...@@ -105,9 +106,13 @@ def main(config, device, logger, vdl_writer):
f_w.write("result: {}, {}\n".format(structure_str_list, f_w.write("result: {}, {}\n".format(structure_str_list,
bbox_list_str)) bbox_list_str))
img = draw_rectangle(file, bbox_list) if len(bbox_list) > 0 and len(bbox_list[0]) == 4:
img = draw_rectangle(file, bbox_list)
else:
img = draw_boxes(cv2.imread(file), bbox_list)
cv2.imwrite( cv2.imwrite(
os.path.join(save_res_path, os.path.basename(file)), img) os.path.join(save_res_path, os.path.basename(file)), img)
logger.info('save result to {}'.format(save_res_path))
logger.info("success!") logger.info("success!")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册